How can i auto-close the picker when click outside the Canvas?

Author: gabrigomezCreated Aug 25, 2022Updated Nov 21, 2025

Hi everyone,

I have an issue to close the picker when i clicked outside it. I'm using the react-canvas and i can't find a solution to close the picker properly, since i can't expand or change the popover size on the div to cover the entire screen.

In the print below, i marked the current div generate with the popover where i can close the picker, but i want to be able to close it when i clicked anywhere in the screen. I have already try to change the css properties of popover, but it won't work, since it is attached on the react-canvas and not in a normal static background.

Can you guys help me with that? Captura de tela de 2022-08-25 17-22-26 (1)

Source: casesandberg/react-color