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

inputId issues #36

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hi Dean,

just to let you know, by chance I discovered that certain things like palette = "limited" break (getting full palette instead) when the inputId and output$...... are the same. Although this is probably not recommended anyway to use, it does normally not cause any issues for other shiny objects, but seems to create quite a mess when it comes to colourpicker::colourInput

daattali commented 5 years ago

Do you mean that the input and output elements have the same ID?

ghost commented 5 years ago

Yes correct

Op di 30 jul. 2019 16:52 schreef Dean Attali notifications@github.com:

Do you mean that the input and output elements have the same ID?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/daattali/colourpicker/issues/36?email_source=notifications&email_token=AHEPI53X3L5EBOIE75PQRT3QCBIRBA5CNFSM4IH2FRPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3EHQLI#issuecomment-516454445, or mute the thread https://github.com/notifications/unsubscribe-auth/AHEPI5YJSJBVHQZGGVGU4YLQCBIRBANCNFSM4IH2FRPA .

daattali commented 5 years ago

Thanks for letting me know. I'm fine with that, because having two elements with the same ID results in technically invalid HTML, IDs are meant to be unique and it's ok to have undefined behaviour when IDs are not unique. I'm sure there are other widgets that also don't function properly when given an ID that exists multiple times (maybe not inputs, but widgets for sure).