Skip to content

Commit

Permalink
Fix dropdown scroll problem on touch devices
Browse files Browse the repository at this point in the history
  • Loading branch information
mictro committed Aug 2, 2022
1 parent 441b124 commit 0d5f9c6
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export class DropdownComponent implements AfterViewInit, OnDestroy, ControlValue
event.preventDefault();
}

/* Utility that makes it easier to set styles on card element
/* Utility that makes it easier to set styles on card element
when using popover*/
private setPopoverCardStyle(style: string, value: string) {
if (!this.usePopover) return;
Expand Down Expand Up @@ -463,6 +463,13 @@ export class DropdownComponent implements AfterViewInit, OnDestroy, ControlValue
}
}

@HostListener('touchstart', ['$event'])
_onTouchStart(event: TouchEvent) {
if (this.isOpen) {
event.stopPropagation();
}
}

@HostListener('focus')
_onFocus() {
if (this.disabled) {
Expand Down

0 comments on commit 0d5f9c6

Please sign in to comment.