Skip to content

Commit d2a1345

Browse files
fix(clerk-js): Ensure buttons have keyboard access when shown (#7306)
1 parent a3e14b1 commit d2a1345

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.changeset/five-animals-pull.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
---
4+
5+
Conditionally apply `tabIndex={-1}` usage when shown to ensure buttons are keyboard accessible.

packages/clerk-js/src/ui/elements/ClipboardInput.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export const ClipboardInput = (props: ClipboardInputProps) => {
3030
<Button
3131
elementDescriptor={descriptors.formFieldInputCopyToClipboardButton}
3232
variant='ghost'
33-
tabIndex={-1}
3433
onClick={onCopy}
3534
sx={{
3635
position: 'absolute',

packages/clerk-js/src/ui/elements/PasswordInput.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>((p
3131
setWarning,
3232
setError,
3333
setHasPassedComplexity,
34+
tabIndex,
3435
...rest
3536
} = props;
3637
const inputRef = useRef<HTMLInputElement>(null);
@@ -86,6 +87,7 @@ export const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>((p
8687
>
8788
<Input
8889
{...rest}
90+
tabIndex={tabIndex}
8991
onChange={onChange}
9092
onBlur={e => {
9193
rest.onBlur?.(e);
@@ -108,7 +110,7 @@ export const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>((p
108110
aria-label={`${hidden ? 'Show' : 'Hide'} password`}
109111
variant='ghost'
110112
size='xs'
111-
tabIndex={-1}
113+
tabIndex={tabIndex}
112114
onClick={() => setHidden(s => !s)}
113115
sx={theme => ({
114116
position: 'absolute',

0 commit comments

Comments
 (0)