Skip to content

Commit 7ffbbc3

Browse files
authored
fix: position ColorLoupe relative to ColorHandle in V3 ColorWheel (#8846)
* fix: position color loupe relative to the color handle in V3 ColorWheel * fix lint
1 parent 38a7696 commit 7ffbbc3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/@react-spectrum/color/src/ColorThumb.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,15 @@ function ColorLoupe({isOpen, valueCSS, containerRef, loupeRef, style}: any) {
6969
let thumbTop = style.top || '50%';
7070
if (typeof thumbTop === 'string' && thumbTop.endsWith('%')) {
7171
thumbTop = parseFloat(style.top || '50%') / 100 * containerRect.height;
72+
} else if (typeof thumbTop === 'string' && thumbTop.endsWith('px')) {
73+
thumbTop = parseFloat(thumbTop);
7274
}
7375

7476
let thumbLeft = style.left || '50%';
7577
if (typeof thumbLeft === 'string' && thumbLeft.endsWith('%')) {
7678
thumbLeft = parseFloat(thumbLeft || '50%') / 100 * containerRect.width;
79+
} else if (typeof thumbLeft === 'string' && thumbLeft.endsWith('px')) {
80+
thumbLeft = parseFloat(thumbLeft);
7781
}
7882

7983
return (

0 commit comments

Comments
 (0)