cocopon / tweakpane

:control_knobs: Compact GUI for fine-tuning parameters and monitoring value changes
https://tweakpane.github.io/docs/
MIT License
3.69k stars 92 forks source link

Inline color picker slider sometimes displays the wrong cursor and cannot be dragged for #FF0000 but works for #00FF00 #630

Closed ccammack closed 2 weeks ago

ccammack commented 4 weeks ago

Here's an example using 4.0.3:

https://codepen.io/ccammack/pen/WNaogKa?editors=1111

2024-10-26 21_11_09-Tweakpane inline picker bug - Brave

cocopon commented 4 weeks ago

Please write out the steps to reproduce and the specific issue. A screen capture would also be helpful.

ccammack commented 3 weeks ago
  1. Using the following code or the sandbox link provided, open one of the red color pickers (#ff0000)
    1. Note that the arrow cursor does not reliably change to a hand while hovered, as shown in the provided image, and that the slider cannot be dragged while the wrong cursor is shown
    2. Open the green color picker (#00ff00) and note that it works properly

Something appears to be stealing the hover on the left side of that slider. Perhaps it's the "RGB" color space selector below.

import * as tweakpane from "https://cdn.skypack.dev/tweakpane@4.0.3";

const pane = new tweakpane.Pane({ });

const PARAMS_0 = { color: '#ff0000', };
pane.addBinding(PARAMS_0, 'color', { picker: 'inline', expanded: false, });

const PARAMS_1 = { color: '#00ff00', };
pane.addBinding(PARAMS_1, 'color', { picker: 'inline', expanded: false, });

const PARAMS_2 = { color: '#ff0000',};
pane.addBinding(PARAMS_2, 'color', { picker: 'inline', expanded: false, });
cocopon commented 3 weeks ago

The sandbox that you shared seems to work fine in my environment.

https://github.com/user-attachments/assets/ce51003a-5735-4eb6-aec2-1ccd663d4019

ccammack commented 3 weeks ago

I don't have a Mac to test, but I see the problem on all of these:

Windows 11 Pro 23H2

Ubuntu 24.04

This video is Ubuntu & Firefox at 200% zoom. The left side of the slider box seems to be the problem.

https://github.com/user-attachments/assets/51108024-0734-4cec-8009-bfd4add83908

cocopon commented 3 weeks ago

Ah, I understand what you mean now.

The knob itself doesn’t have a hit area, but the track does, in the current implementation. This can be improved by extending a hit area of the track.

cocopon commented 2 weeks ago

Fixed in 4.0.5.