|
// Trigger a "close" event |
|
prevEl.dispatchEvent(new Event('close', { bubbles: true })); |
With this code, Coloris dispatches an event that will cause issues if it's inside a dialog.
The dialog itself has a close event (https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/close_event) which might be used to remove it's contents or whatever a user wants to do with it.
Since Coloris sends that ambiguous event name, the dialog might not be closed but still execute attached event listeners.
You might want to rename this to something unique, like you do with coloris:pick
|
document.dispatchEvent(new CustomEvent('coloris:pick', { detail: { color, currentEl } })); |
Coloris/src/coloris.js
Lines 534 to 535 in 5b79ac1
With this code, Coloris dispatches an event that will cause issues if it's inside a dialog.
The dialog itself has a close event (https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/close_event) which might be used to remove it's contents or whatever a user wants to do with it.
Since Coloris sends that ambiguous event name, the dialog might not be closed but still execute attached event listeners.
You might want to rename this to something unique, like you do with
coloris:pickColoris/src/coloris.js
Line 600 in 5b79ac1