rydmike / flex_color_picker

A highly customizable Flutter color picker.
BSD 3-Clause "New" or "Revised" License
200 stars 42 forks source link

Inner circle does not move #67

Closed GAayushi closed 1 year ago

GAayushi commented 1 year ago

I'm facing this problem, that while using colour wheel, if I try to move the inner square selector circle, sometimes it doesn't move, instead the outer circle move. This problem occurs mostly when inner circle is at any corner or on the outer edges of the square. We need to click on the square first then the inner circle moves. Any fixes for this?

rydmike commented 1 year ago

Thanks @GAayushi for this report, and I agree, I have noticed this too, it is an issue, well at least a nuisance. Looks like I need to take another look at the hit testing and improve it a bit.

rydmike commented 1 year ago

Hi @GAayushi, thanks for raising this issue. Hope you have had a chance to try the FIX. At least in my tests, clicking on circle or box is now reliable. This issue had been bothering me too, not sure why I had not looked into before. Anyway let me know what you think, hope it works well for you too.

edwardocano commented 8 months ago

Hello! I am having this same issue , in iOS when i use the square it is now reliable when the selector is in the corners i need to try several times to move it.

rydmike commented 8 months ago

Hi @edwardocano, this is an old closed issue. If you are still experiencing an issue with it, please open a new issue that demonstrates the issue clearly.

The issue referred to here, with accidental move of the outer ring, has been fixed as they now have different region detectors.

Concerning the selector in the square, you can only move the selector, if the tap happens inside the square color gardient box. Tapping on the selector on a part that is outside the square, does indeed not move it. This is expected designed behavior with current implementation.

This recording demonstrates this behavior:

https://github.com/rydmike/flex_color_picker/assets/39990307/947fd792-83c4-48d4-89c7-56eed93e2e0b

You can also move the selector by tapping down anywhere in the square box, so inside the square, or on the selector, or just outside it a bit too but on the square. By doing so it is not so difficult to start moving it.

It could perhaps be changed to not need to be this precisely in the square somewhere, and also count when it is on the round selector in the square. However, one of the challenges with that is that the ColorPicker allows designs where the square and wheel touch, and the selector on the wheel and square can overlap in such cases, thus creating a conflict of which one should win. To avoid this, initial down-touch, only count from the square, for square selector or the wheel, for the wheel selector.

A potential solution is of course to always let the selector for the square win in such a case. This might be considered better UX as it would become easier to move it when it is on edges, only rarely would you have a conflict with the ring selector, which might well be understandable when they overlap. I might look into if I can support this behavior.