casesandberg / react-color

:art: Color Pickers from Sketch, Photoshop, Chrome, Github, Twitter & more
http://casesandberg.github.io/react-color/
MIT License
12.05k stars 922 forks source link

Color picker closing automatically on clicking #895

Closed Parth909 closed 11 months ago

Parth909 commented 11 months ago

Version : 2.19.3 React Version :- v18

Problem Faced

The color picker is closing automatically on clicking or when I try to type something in it. You can see it in the below video 👇 . What can I do to prevent it from closing automatically.

https://github.com/casesandberg/react-color/assets/59220026/e60df4ee-58dd-493c-91c5-9b26fa09d56e

Code Snippet

<div
                    className={`tw-py-1 tw-h-auto tw-overflow-y-auto ${surveyStyles.survey_card_shadow}`}
                  >
                    <ChromePicker
                      color={rgbToHex(
                        formBackground[0],
                        formBackground[1],
                        formBackground[2]
                      )}
                      onChange={(data) => {
                        setFormBackground([data.rgb.r, data.rgb.g, data.rgb.b]);
                      }}
                    />
                  </div>