mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 04:52:45 +08:00
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) => {
|
||||
this.menuInstance.trigger = element;
|
||||
this.options.onRegisterApi?.(this.menuInstance);
|
||||
|
||||
return () => {
|
||||
this.menuInstance.destroy();
|
||||
};
|
||||
});
|
||||
|
||||
get menuId() {
|
||||
|
|
|
@ -23,6 +23,10 @@ export default class DTooltip extends Component {
|
|||
registerTrigger = modifier((element) => {
|
||||
this.tooltipInstance.trigger = element;
|
||||
this.options.onRegisterApi?.(this.tooltipInstance);
|
||||
|
||||
return () => {
|
||||
this.tooltipInstance.destroy();
|
||||
};
|
||||
});
|
||||
|
||||
get options() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user