FIX: correctly destroy menu/tooltip when removed from dom
This fix will ensure we correctly play the close/destroy sequence in this situation.
This commit is contained in:
parent
93443adf22
commit
96b88f34a2
|
@ -25,6 +25,10 @@ export default class DMenu extends Component {
|
||||||
registerTrigger = modifier((element) => {
|
registerTrigger = modifier((element) => {
|
||||||
this.menuInstance.trigger = element;
|
this.menuInstance.trigger = element;
|
||||||
this.options.onRegisterApi?.(this.menuInstance);
|
this.options.onRegisterApi?.(this.menuInstance);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
this.menuInstance.destroy();
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
get menuId() {
|
get menuId() {
|
||||||
|
|
|
@ -23,6 +23,10 @@ export default class DTooltip extends Component {
|
||||||
registerTrigger = modifier((element) => {
|
registerTrigger = modifier((element) => {
|
||||||
this.tooltipInstance.trigger = element;
|
this.tooltipInstance.trigger = element;
|
||||||
this.options.onRegisterApi?.(this.tooltipInstance);
|
this.options.onRegisterApi?.(this.tooltipInstance);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
this.tooltipInstance.destroy();
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
get options() {
|
get options() {
|
||||||
|
|
Loading…
Reference in New Issue