Closed DEfusion closed 4 years ago
Note I'm not totally happy with this approach but it seemed the easiest way to address this particular issue after exploring other avenues.
Oh my, I'm so sorry I only saw the issue and fixed it immediately on my own :/ Thank you a lot for your efforts! Yes, yours seem to be a solution, in my case I just remove the alternative condition for the widget to be visible :) It's basically the same as yours but in my case I do the whole check-if-it-is-visible thing at the very beginning.
@Simonwep Yeah I wasn't sure about this approach as I said in my comment and you're obviously much more familiar with the code; however the change 0d445e57 does cause the callback to run continuously on every frame until the pickr is opened, which in some cases may be never.
I know it's a cheap callback which exits quickly but I wondered if that could be avoided, so I've given it another stab in #229
If the container the pickr is output in is not visible when it is created the position of the movable handles is not shown correctly on opening, this then has the knock-on effect of not setting the color correctly on interaction unless you click on the palette or a swatch first.
This change addresses that by checking if the container is visible via a offsetParent check in
_finalBuild
and does not finalize the build until it is by calling_finalBuild
onshow
calls.Fixes #226