Skip to content

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

Merged
merged 3 commits into from
Sep 1, 2021
Merged

Conversation

alextanlan
Copy link
Contributor

@alextanlan alextanlan commented Aug 30, 2021

Fix a case when an autocomplete list is scrolled above the header.

Before:
image

After:
image


@HostListener('window: scroll') public onWindowScroll(): void {
if (this.autoComplete?.panelOpen) {
this.autoComplete.closePanel();
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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
@alextanlan alextanlan changed the title DDP-6918 [Pancan] Hide autocomplete list when a page/window is scrolled DDP-6918 [Pancan] Fix autocomplete scrolling Aug 31, 2021
@@ -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;
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, fixed.

@alextanlan alextanlan merged commit 03c095b into develop Sep 1, 2021
@alextanlan alextanlan deleted the DDP-6918-fix branch September 1, 2021 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants