UNPKG

@a11d/non-inertable-component

Version:
13 lines (12 loc) 411 B
import { Component } from '@a11d/lit'; export class NonInertableComponent extends Component { static get observedAttributes() { return [...super.observedAttributes, 'inert']; } attributeChangedCallback(name, old, value) { if (name === 'inert' && value !== null) { this.removeAttribute('inert'); } super.attributeChangedCallback(name, old, value); } }