-
Notifications
You must be signed in to change notification settings - Fork 4
DDP-6918 [Pancan] Fix autocomplete scrolling #869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
@HostListener('window: scroll') public onWindowScroll(): void { | ||
if (this.autoComplete?.panelOpen) { | ||
this.autoComplete.closePanel(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about using updatePosition api (https://material.angular.io/components/autocomplete/api) instead of closing the popup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not help in our case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed to keep the autocomplete dropdown under the header by scrolling.
as to keep autocomplete dropdowns under the header by scrolling
@@ -44,12 +54,13 @@ import { ConfigurationService } from '../../../services/configuration.service'; | |||
`] | |||
}) | |||
export class AutocompleteActivityPicklistQuestion extends BaseActivityPicklistQuestion implements OnInit, OnDestroy, OnChanges { | |||
private readonly ngUnsubscribe = new Subject(); | |||
@ViewChild(MatAutocompleteTrigger, {read: MatAutocompleteTrigger}) autoComplete: MatAutocompleteTrigger; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove this viewchild property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, fixed.
Fix a case when an autocomplete list is scrolled above the header.
Before:

After:
