Skip to content

Commit ae6bcc4

Browse files
committed
fix(slider): 🩹 remove visually hidden in input
1 parent 6cb5fdc commit ae6bcc4

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/slider/slider-input.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import * as React from "react";
2-
import { VisuallyHidden } from "ariakit";
3-
import { useForkRef, useWrapElement } from "ariakit-utils";
1+
import { useForkRef } from "ariakit-utils";
42
import {
53
createComponent,
64
createElement,
@@ -16,10 +14,6 @@ export const useSliderInput = createHook<SliderInputOptions>(
1614
props = { ...props, ref: useForkRef(state.inputRef, props.ref) };
1715
props = mergeProps(state.inputProps, props);
1816

19-
props = useWrapElement(props, element => (
20-
<VisuallyHidden>{element}</VisuallyHidden>
21-
));
22-
2317
return props;
2418
},
2519
);

src/slider/slider-thumb.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as React from "react";
2+
import { VisuallyHidden } from "ariakit";
23
import {
34
createComponent,
45
createElement,
@@ -12,7 +13,11 @@ import { SliderThumbState } from "./slider-thumb-state";
1213

1314
export const useSliderThumb = createHook<SliderThumbOptions>(
1415
({ state, ...props }) => {
15-
const children = <SliderInput state={state} />;
16+
const children = (
17+
<VisuallyHidden>
18+
<SliderInput state={state} />
19+
</VisuallyHidden>
20+
);
1621

1722
props = { children, ...props };
1823
props = mergeProps(state.thumbProps, props);

0 commit comments

Comments
 (0)