Skip to content

Commit 3287cbf

Browse files
committed
fix(Colorful): center circle around cursor in Colorful picker #169.
1 parent 365cbc3 commit 3287cbf

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

packages/color-colorful/src/index.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const Pointer = ({ style, color, ...props }: React.HTMLAttributes<HTMLDivElement
2626
height: 28,
2727
width: 28,
2828
position: 'absolute',
29-
transform: 'translate(-14px, -4px)',
29+
transform: 'translate(-16px, -10px)',
3030
boxShadow: '0 2px 4px rgb(0 0 0 / 20%)',
3131
borderRadius: '50%',
3232
background: `url(${BACKGROUND_IMG})`,
@@ -41,7 +41,7 @@ const Pointer = ({ style, color, ...props }: React.HTMLAttributes<HTMLDivElement
4141
style={{
4242
backgroundColor: color,
4343
borderRadius: '50%',
44-
height: ' 100%',
44+
height: '100%',
4545
width: '100%',
4646
}}
4747
/>
@@ -69,9 +69,7 @@ const Colorful = React.forwardRef<HTMLDivElement, ColorfulProps>((props, ref) =>
6969
className={prefixCls}
7070
radius="8px 8px 0 0"
7171
style={{ width: 'auto', height: 150, minWidth: 120, borderBottom: '12px solid #000' }}
72-
pointer={({ left, top, color }) => (
73-
<Pointer style={{ left, top, transform: 'translate(-16px, -16px)' }} color={hsvaToHex(hsva)} />
74-
)}
72+
pointer={({ left, top, color }) => <Pointer style={{ left, top }} color={hsvaToHex(hsva)} />}
7573
onChange={(newColor) => handleChange({ ...hsva, ...newColor })}
7674
/>
7775
<Hue

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"@wcj/dark-mode": "^1.0.14",
4343
"react": "~18.2.0",
4444
"react-dom": "~18.2.0",
45-
"react-router-dom": "^6.20.0"
45+
"react-router-dom": "~7.3.0"
4646
},
4747
"devDependencies": {
4848
"@kkt/less-modules": "^7.2.0",

0 commit comments

Comments
 (0)