Skip to content

Commit

Permalink
fix(slider): 🩹 remove visually hidden in input
Browse files Browse the repository at this point in the history
  • Loading branch information
navin-moorthy committed Jun 17, 2022
1 parent 6cb5fdc commit ae6bcc4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 1 addition & 7 deletions src/slider/slider-input.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import * as React from "react";
import { VisuallyHidden } from "ariakit";
import { useForkRef, useWrapElement } from "ariakit-utils";
import { useForkRef } from "ariakit-utils";
import {
createComponent,
createElement,
Expand All @@ -16,10 +14,6 @@ export const useSliderInput = createHook<SliderInputOptions>(
props = { ...props, ref: useForkRef(state.inputRef, props.ref) };
props = mergeProps(state.inputProps, props);

props = useWrapElement(props, element => (
<VisuallyHidden>{element}</VisuallyHidden>
));

return props;
},
);
Expand Down
7 changes: 6 additions & 1 deletion src/slider/slider-thumb.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from "react";
import { VisuallyHidden } from "ariakit";
import {
createComponent,
createElement,
Expand All @@ -12,7 +13,11 @@ import { SliderThumbState } from "./slider-thumb-state";

export const useSliderThumb = createHook<SliderThumbOptions>(
({ state, ...props }) => {
const children = <SliderInput state={state} />;
const children = (
<VisuallyHidden>
<SliderInput state={state} />
</VisuallyHidden>
);

props = { children, ...props };
props = mergeProps(state.thumbProps, props);
Expand Down

0 comments on commit ae6bcc4

Please sign in to comment.