Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
? this.$refs.helpertextEl.foundation
: void 0,
leadingIcon: this.$refs.leadingIconEl
? this.$refs.leadingIconEl.foundation
: undefined,
},
);
if (this.menu_) {
this.menu_.listen(
MDCMenuSurfaceFoundation.strings.CLOSED_EVENT,
this.handleMenuClosed,
);
this.menu_.listen(
MDCMenuSurfaceFoundation.strings.OPENED_EVENT,
this.handleMenuOpened,
);
this.menu_.listen(
MDCMenuFoundation.strings.SELECTED_EVENT,
this.handleMenuItemAction,
);
}
this.foundation.init();
// this.foundation.handleChange(false);
// initial sync with DOM
this.refreshIndex();
// this.slotObserver = new MutationObserver(() => this.refreshIndex());
// this.slotObserver.observe(this.$refs.native_control, {
// childList: true,
beforeDestroy() {
// this.slotObserver.disconnect();
if (this.menu_) {
this.menu_.unlisten(
MDCMenuSurfaceFoundation.strings.SELECTED_EVENT,
this.handleMenuItemAction,
);
this.menu_.unlisten(
MDCMenuSurfaceFoundation.strings.OPENED_EVENT,
this.handleMenuOpened,
);
this.menu_.unlisten(
MDCMenuSurfaceFoundation.strings.CLOSED_EVENT,
this.handleMenuClosed,
);
}
const foundation = this.foundation;
this.foundation = null;