Skip to content

bug(mat-option in mat-autocomplete): After deleting chips, mat-autocomplete does not change position. #26097

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

Closed
1 task
Satlykov opened this issue Nov 27, 2022 · 4 comments
Labels
needs triage This issue needs to be triaged by the team

Comments

@Satlykov
Copy link

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When remove chips, we don't have trigger for change position mat-autocomplete.

Reproduction

Steps to reproduce:

  1. Visit https://material.angular.io/components/chips/examples
  2. Look first example "Chips Autocomplete"
  3. Select chips like on example (to have two rows).
  4. When is open mat-autocomplete, delete all chips on second row for change size area of chips.

Screen Recording (11-27-2022 7-20-19 PM)
Screen Recording (11-27-2022 7-22-06 PM)

Expected Behavior

Update the position mat-autocomplete when resizing the area of chips.

Actual Behavior

After deleting chips, mat-autocomplete does not change position.

Environment

  • Angular: 13
  • CDK/Material: 13.2.2
  • Browser(s): Google Chrome Version 107.0.5304.107 (Official Build) (64-bit)
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 10 Pro 19044.2251
@Satlykov Satlykov added the needs triage This issue needs to be triaged by the team label Nov 27, 2022
@RobinKamps
Copy link

This issue is a side affect/related of a long discussed issue with scrolling behaviour of the autocomplete panel (e.g. #10079).
The autocomplete panel is bound to the html/body - perhaps to fix this issue in the context with chips, a click (focus) on chip/remove could just close the autocomplete panel.
And the scrolling schould be disabled for the underlying div (#26048)

@Satlykov
Copy link
Author

@RobinKamps
I have read these issues, and they have a solution with cdkScrollable.
I hope that for the issue is a similar solution with an internal mechanism.
I thought about using methods like openPanel() or *ngIf with a custom flag, but I think it's a not well solution.
Thanks for your reply!

@RobinKamps
Copy link

@Satlykov
yes - cdkScrollable could be used as a performance breaking workaround for the scrolling issue, but it does not work on this chip remove issue, since there is no scrolling involved, if a chip remove button is clicked.

Perhaps its an option for you to add viewchild and close the autocomplete panel on chip remove.
Like:

https://stackblitz.com/edit/angular-6fg5hr?file=src%2Fapp%2Fchips-autocomplete-example.html,src%2Fapp%2Fchips-autocomplete-example.ts

Kind regards.

@Satlykov Satlykov closed this as completed Dec 6, 2022
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jan 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs triage This issue needs to be triaged by the team
Projects
None yet
Development

No branches or pull requests

2 participants