Skip to content

Commit 2c4b1dc

Browse files
committed
refactor: use display: none instead of visually hidden to hide the input
1 parent ddb1e00 commit 2c4b1dc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/@react-aria/select/src/HiddenSelect.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,13 @@ export function HiddenSelect<T>(props: HiddenSelectProps<T>): JSX.Element | null
153153
};
154154

155155
if (validationBehavior === 'native') {
156-
// Use a visually hidden <input type="text"> rather than <input type="hidden">
156+
// Use a hidden <input type="text"> rather than <input type="hidden">
157157
// so that an empty value blocks HTML form submission when the field is required.
158158
return (
159159
<input
160-
{...containerProps}
161160
{...inputProps}
161+
style={{display: 'none'}}
162162
type="text"
163-
tabIndex={-1}
164163
required={selectProps.required}
165164
onChange={() => {/** Ignore react warning. */}}
166165
onInvalid={(e) => {

0 commit comments

Comments
 (0)