Skip to content

Commit d7dca0c

Browse files
authored
fix: ColorWheel inner border width (#9440)
* s2: fix ColorWheel inner border width * add new stories
1 parent 0f61fbc commit d7dca0c

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

packages/@react-spectrum/s2/chromatic/ColorWheel.stories.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,14 @@ export const Example: StoryObj<typeof ColorWheel> = {
2929
defaultValue: 'hsl(30, 100%, 50%)'
3030
}
3131
};
32+
33+
export const InContainer: StoryObj<typeof ColorWheel> = {
34+
render: (args) => (
35+
<div style={{width: 600, border: '1px solid gray', padding: 16}}>
36+
<ColorWheel {...args} onChange={undefined} />
37+
</div>
38+
),
39+
args: {
40+
defaultValue: 'hsl(30, 100%, 50%)'
41+
}
42+
};

packages/@react-spectrum/s2/src/ColorWheel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const ColorWheel = forwardRef(function ColorWheel(props: ColorWheelProps,
5151
outerRadius={outerRadius}
5252
innerRadius={innerRadius}
5353
ref={containerRef}
54-
style={UNSAFE_style}
54+
style={{...UNSAFE_style, width: outerRadius * 2, height: outerRadius * 2}}
5555
className={UNSAFE_className + styles}>
5656
{({isDisabled, state}) => (<>
5757
<ColorWheelTrack

packages/@react-spectrum/s2/stories/ColorWheel.stories.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,14 @@ export const Example: Story = {
3939
defaultValue: 'hsl(30, 100%, 50%)'
4040
}
4141
};
42+
43+
export const InContainer: Story = {
44+
render: (args) => (
45+
<div style={{width: 600, border: '1px solid gray', padding: 16}}>
46+
<ColorWheel {...args} onChange={undefined} />
47+
</div>
48+
),
49+
args: {
50+
defaultValue: 'hsl(30, 100%, 50%)'
51+
}
52+
};

0 commit comments

Comments
 (0)