Skip to content

Commit 962734b

Browse files
committed
feat: add interactionBox
1 parent 9f1cc30 commit 962734b

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

src/components/primitives/Slider/SliderThumb.tsx

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ function SliderThumb(props: ISliderThumbProps, ref: any) {
3434
thumbSize,
3535
isReadOnly,
3636
isDisabled,
37+
_interactionBox: interactionBoxContext,
3738
} = React.useContext(SliderContext);
3839
const {
3940
onFocus,
@@ -45,6 +46,7 @@ function SliderThumb(props: ISliderThumbProps, ref: any) {
4546
'SliderThumb',
4647
{
4748
size: thumbSize,
49+
_interactionBox: interactionBoxContext,
4850
colorScheme,
4951
...props,
5052
},
@@ -98,7 +100,7 @@ function SliderThumb(props: ISliderThumbProps, ref: any) {
98100
...stylingProps.layout,
99101
...stylingProps.flexbox,
100102
...stylingProps.position,
101-
'_text',
103+
...stylingProps.outline,
102104
]);
103105

104106
const [
@@ -120,7 +122,8 @@ function SliderThumb(props: ISliderThumbProps, ref: any) {
120122
{...thumbProps}
121123
{...resolvedProps}
122124
{...accessibilityProps}
123-
style={[thumbStyles, props.style]}
125+
{...layoutProps}
126+
style={[thumbStyles, resolvedProps.style]}
124127
onFocus={(e: any) => {
125128
handleFocus(true, onFocus ? () => onFocus(e) : () => {});
126129
}}
@@ -131,19 +134,15 @@ function SliderThumb(props: ISliderThumbProps, ref: any) {
131134
// {...(isDisabled && _disabled)}
132135
ref={mergeRefs([_ref, ref])}
133136
>
134-
<Stack {...layoutProps} {..._stack}>
135-
<Center>
136-
<Box {..._interactionBox} size={thumbSize} />
137-
<Center {...nonAccessibilityProps}>
138-
<Box>
139-
{props.children}
140-
{Platform.OS === 'web' && (
141-
<VisuallyHidden>
142-
<input ref={inputRef} {...inputProps} />
143-
</VisuallyHidden>
144-
)}
145-
</Box>
146-
</Center>
137+
<Stack {..._stack}>
138+
<Box {..._interactionBox} />
139+
<Center {...nonAccessibilityProps}>
140+
{props.children}
141+
{Platform.OS === 'web' && (
142+
<VisuallyHidden>
143+
<input ref={inputRef} {...inputProps} />
144+
</VisuallyHidden>
145+
)}
147146
</Center>
148147
</Stack>
149148
</Box>

0 commit comments

Comments
 (0)