|
|
import isModifierEnabled from '../utils/isModifierEnabled'; |
|
|
import getSupportedPropertyName from '../utils/getSupportedPropertyName'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default function destroy() { |
|
|
this.state.isDestroyed = true; |
|
|
|
|
|
|
|
|
if (isModifierEnabled(this.modifiers, 'applyStyle')) { |
|
|
this.popper.removeAttribute('x-placement'); |
|
|
this.popper.style.position = ''; |
|
|
this.popper.style.top = ''; |
|
|
this.popper.style.left = ''; |
|
|
this.popper.style.right = ''; |
|
|
this.popper.style.bottom = ''; |
|
|
this.popper.style.willChange = ''; |
|
|
this.popper.style[getSupportedPropertyName('transform')] = ''; |
|
|
} |
|
|
|
|
|
this.disableEventListeners(); |
|
|
|
|
|
|
|
|
|
|
|
if (this.options.removeOnDestroy) { |
|
|
this.popper.parentNode.removeChild(this.popper); |
|
|
} |
|
|
return this; |
|
|
} |
|
|
|