What are you trying to do?
I'm trying to implement a generic auto completion.
My code is structured in following way
dsAutocomplete directive is top level directive
dsAutocompleteInputTrigger is directive attached to <input> element
dsAutoCompleteOrigin is attached to element on whose drop down need to be anchored
*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
What are you trying to do?
I'm trying to implement a generic auto completion.
My code is structured in following way
dsAutocompletedirective is top level directivedsAutocompleteInputTriggeris directive attached to<input>elementdsAutoCompleteOriginis attached to element on whose drop down need to be anchored*dsAutocompletePanelis a structural directive to define what is dropdownFlow of actions is
For opening
dsAutocompleteInputTrigger.focus->dsAutocomplete.openPanel->overlayRef.attach(TemplatePortal(dsAutocompletePanel))as FlexibleConnected todsAutoCompleteOriginFor 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