UNPKG

@playbooks/utils

Version:

A collection of utilities used for Playbooks.

10 lines (9 loc) 317 B
const clearInput = (element) => { const nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value").set; nativeInputValueSetter.call(element, ""); const inputEvent = new Event("input", { bubbles: true }); element.dispatchEvent(inputEvent); }; export { clearInput };