Skip to content

Commit c68030b

Browse files
authored
Merge pull request #13 from clarivate/suyog/bugfix-click-event-indpt-of-keyup-event
event handler for keyboard and click event
2 parents 2f98522 + 5ae4e36 commit c68030b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

projects/angular-image-viewer/src/lib/angular-image-viewer.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,11 @@ export class AngularImageViewerComponent implements OnInit, OnChanges {
205205
}
206206

207207
private canNavigate(event: any) {
208-
return event == null || (this.config.allowKeyboardNavigation && this.hovered);
208+
if (event.type === 'keyup') {
209+
return event == null || (this.config.allowKeyboardNavigation && this.hovered);
210+
} else if (event.type === 'click') {
211+
return event == null || this.hovered;
212+
}
209213
}
210214

211215
private updateStyle() {

0 commit comments

Comments
 (0)