Closed h-eriksson closed 1 year ago
Quick update: Found a workaround, and emphasis on workaround.
It is possible to grab the color-picker in the 'open' event-handler, store it to a variable, remove it from the DOM, and then append it to the modal dialog as a child. This requires some finessing with the position though as the color-picker is relative to the viewport. In the modal, those coordinates will displace the color-picker drastically as it's related to the dialog now. Fully workable so far anyway, but would be preferable if the color-picker is opened directly as a child to the dialog when the Coloris-element is a child of it.
Isn't that what the "parent" attribute of the colorPicker is for to where you want it attached else it defaults to DOM Body?
Indeed! You need to set the parent
option in this case.
And here we have it. Proof positive that I should never "just figure it out before bed", and go to bed instead, when the problem IS THE VERY FIRST ITEM in the documentation. I feel a bit dumb now. Thanks guys.
So, should this entire thread be removed now?
Glad you got it to work. Let's leave this archived for users who might have the same issue.
First time reporting an issue. I hope I'm doing this right.
If a dialog tag, opened through .showModal() is used to display the Coloris element, when activated, the actual color-picker is opened behind it. The Coloris-element is showing up as expected on the modal though. As the color-picker seems to be part of the normal DOM-flow, instead of the modals flow, it can't be accessed. If the modal is large enough, the color-picker is completely blocked from view, and will not even show to the user.