daattali / colourpicker

🎨 A colour picker tool for Shiny and for selecting colours in plots (in R)
https://daattali.com/shiny/colourInput/
Other
217 stars 28 forks source link

Input binding Issue - Initialize colourpicker $(el) #44

Closed Seyphaton closed 3 years ago

Seyphaton commented 3 years ago

Hey,

in my Shiny app the code below causes some problems: var $el = this._jqid(el.id); // for some reason using $(el) doesn't work In my case _jqid returns undefined and the initlization of the colourpicker fails. I replaced the line by var inputElement = $(el) and everything works fine.

https://github.com/daattali/colourpicker/blob/50dc1dc7020dfce52919611d8180d6ccb6809e6e/inst/srcjs/input_binding_colour.js#L24

Why do you use this workaround?

Best regards

daattali commented 3 years ago

I haven't touched this code in many years so I really don't remember, but based on that comment it seems that this was in order to get the input to work more consistently. I don't remember what cases wouldn't work otherwise.

But this is the first time someone reports this issue so I'm curious what'shappening to you, can you share a minimal reprex please

daattali commented 3 years ago

Feel free to reopen if you have information/a reproducible example to share