Open Cypaaa opened 4 months ago
Here is an updated version of the code containing initEvent:
// utility functions
function triggerClick(el) {
const event = new MouseEvent("click", {
bubbles: true,
cancelable: false,
});
el.dispatchEvent(event);
}
function triggerChange(el) {
const event = new Event("change", {
bubbles: true,
cancelable: false,
});
el.dispatchEvent(event);
}
function triggerFocusIn(el) {
const event = new FocusEvent("focusin", {
bubbles: true,
cancelable: false,
});
el.dispatchEvent(event);
}
function triggerFocusOut(el) {
const event = new FocusEvent("focusout", {
bubbles: true,
cancelable: false,
});
el.dispatchEvent(event);
}
function triggerModalOpen(el) {
const event = new UIEvent("modalopen", {
bubbles: true,
cancelable: false,
});
el.dispatchEvent(event);
}
function triggerModalClose(el) {
const event = new UIEvent("modalclose", {
bubbles: true,
cancelable: false,
});
el.dispatchEvent(event);
}
Hi, I saw the nice-select2.js file contains a lot of initEvent which is deprecated. You should consider updating the code to keep the support of every browser.
Here is the documentation url in case you cannot click the link above: https://developer.mozilla.org/en-US/docs/Web/API/Event/initEvent