@a11d/non-inertable-component
Version:
A non-inertable Lit component
13 lines (12 loc) • 411 B
JavaScript
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);
}
}