@wordpress/block-editor
Version:
40 lines (31 loc) • 805 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.__unstableRichTextInputEvent = void 0;
var _element = require("@wordpress/element");
/**
* WordPress dependencies
*/
class __unstableRichTextInputEvent extends _element.Component {
constructor() {
super(...arguments);
this.onInput = this.onInput.bind(this);
}
onInput(event) {
if (event.inputType === this.props.inputType) {
this.props.onInput();
}
}
componentDidMount() {
document.addEventListener('input', this.onInput, true);
}
componentWillUnmount() {
document.removeEventListener('input', this.onInput, true);
}
render() {
return null;
}
}
exports.__unstableRichTextInputEvent = __unstableRichTextInputEvent;
//# sourceMappingURL=input-event.js.map