Skip to content

bug(material-autocomplete): (overlayOutsideClick) condradicts with (optionSelected) #25238

@muneebkq

Description

@muneebkq

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

whenever i select an option from autocomplete panel the overlayOutsideClick function of overlay gets called which closes everything.

Reproduction

https://stackblitz.com/edit/angular-ivy-mtmkgh?file=src/app/app.component.html
Steps to reproduce:

  1. Click on add button
  2. After the autocomplete panel appears, click outside the overlay panel and overlayOutsideClick get exe
  3. Repeat the first step and click on the option. Instead of value appearing inside input its overlay gets closed.
  4. To understand actual behavior, remove the overlayOutsideClick property from cdkoverlay element. Then repeat the 3 and then 2 steps.

Expected Behavior

whenever I select an option from autocomplete panel it should get selected and on clicking outside overlay the overlayOutsideClick func should get exe.
an

Actual Behavior

whenever i select an option from autocomplete panel the overlayOutsideClick function of overlay gets called which closes everything.
Note: This might be the issue because autocomplete does not get rendered inside overlay because of maybe position absolute

Environment

  • Angular:
  • CDK/Material:
  • Browser(s):
  • Operating System (e.g. Windows, macOS, Ubuntu):

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/overlay

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions