casesandberg / casesandberg/react-color

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

Open
#865 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12.3k
Forks
920
PR merge metrics
No merged PRs in 30d

Description

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)](https://user-images.githubusercontent.com/69373145/186762914-97cb3802-69e2-47e6-b708-439c065b9bb4.png)

Contributor guide

Open the contributing guide

Research direction

No file, test, or entry point is named. Start by reproducing the picker behavior described with react-canvas and trace how the popover handles clicks; the work is done when clicking anywhere outside the picker closes it without preventing normal canvas interaction.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.