You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In dropdown component, this.popover is initialized in firstUpdated hook, but is destroyed in disconnectedCallback , thus when removing the dropdown from DOM and then appending again the popover is broken.
To Reproduce
Create a sl-dropdown
Programmatically remove it from DOM
Append back to DOM
Open and then close the dropwdown, it's remaining open, cause this.popover.hide() can't be called (this.popover is destroyed)
Expected behavior
Dropdown should keep working as intended when programmatically moving within DOM.
The text was updated successfully, but these errors were encountered:
ex37
added
the
bug
Things that aren't working right in the library.
label
May 25, 2021
Hi @claviska thanks for fast response!
I spent some time and reviewed other occurrences where firstUpdated is used, and just by looking at the code (haven't tried to reproduce any of these), here is what I found:
this.popover = new Popover(this.target, this.positioner); should be moved to connectedCallback,
as well as all of the event listeners. Maybe also this.target = this.getTarget();, not sure about this one, but overall in the current state I find tooltip component not enought dynamic and ended up wraping it into my own one. If you are interested I can collaborate my thoughts on this component.
Describe the bug
In
dropdown
component,this.popover
is initialized infirstUpdated
hook, but is destroyed indisconnectedCallback
, thus when removing the dropdown from DOM and then appending again the popover is broken.To Reproduce
sl-dropdown
this.popover.hide()
can't be called (this.popover
is destroyed)Expected behavior
Dropdown should keep working as intended when programmatically moving within DOM.
The text was updated successfully, but these errors were encountered: