Skip to content

help(Overlay): Animation works only on first attachment ,  #24749

Closed
@abdulkareemnalband

Description

@abdulkareemnalband

What are you trying to do?

I'm trying to implement a generic auto completion.

My code is structured in following way

  1. dsAutocomplete directive is top level directive
  2. dsAutocompleteInputTrigger is directive attached to <input> element
  3. dsAutoCompleteOrigin is attached to element on whose drop down need to be anchored
  4. *dsAutocompletePanel is a structural directive to define what is dropdown

Flow of actions is

For opening
dsAutocompleteInputTrigger.focus -> dsAutocomplete.openPanel -> overlayRef.attach(TemplatePortal(dsAutocompletePanel)) as FlexibleConnected to dsAutoCompleteOrigin

For closing
dsAutocompleteInputTrigger.focusout -> dsAutocomplete.closePanel -> overlayRef.detach()

when I add an animation directive any where in AutoComplete Panel it only works first time

What troubleshooting steps have you tried?

Tried adding attach and detach in zone.run

Reproduction

follow instruction in following stackblitz
https://stackblitz.com/edit/angular-ivy-smmzcq?file=src%2Fapp%2Fapp.component.html

Environment

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

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