Skip to content

Commit 13a1eec

Browse files
committed
chore: Address PR comments
1 parent 70f0988 commit 13a1eec

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

packages/clerk-js/src/ui/customizables/elementDescriptors.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export const APPEARANCE_KEYS = containsAllElementsConfigKeys([
9898
'otpCodeField',
9999
'otpCodeFieldInputs',
100100
'otpCodeFieldInput',
101+
'otpCodeFieldInputContainer',
101102
'otpCodeFieldErrorText',
102103
'formResendCodeLink',
103104

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,10 @@ export const OTPCodeControl = React.forwardRef<{ reset: any }>((_, ref) => {
303303
const centerSx = centerAlign ? { justifyContent: 'center', alignItems: 'center' } : {};
304304

305305
return (
306-
<Box sx={{ position: 'relative' }}>
306+
<Box
307+
elementDescriptor={descriptors.otpCodeFieldInputContainer}
308+
sx={{ position: 'relative' }}
309+
>
307310
{/* Hidden input for password manager compatibility */}
308311
<Input
309312
ref={hiddenInputRef}
@@ -322,14 +325,10 @@ export const OTPCodeControl = React.forwardRef<{ reset: any }>((_, ref) => {
322325
// When password manager focuses the hidden input, focus the first visible input
323326
focusInputAt(0);
324327
}}
325-
sx={theme => ({
326-
position: 'absolute',
328+
sx={() => ({
329+
...common.visuallyHidden(),
327330
left: '-9999px',
328-
width: `calc(1px + ${passwordManagerOffset}px)`,
329-
height: '1px',
330-
opacity: theme.opacity.$hidden,
331331
pointerEvents: 'none',
332-
clipPath: `inset(0 ${passwordManagerOffset}px 0 0)`,
333332
})}
334333
/>
335334

packages/clerk-js/src/ui/foundations/opacity.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export const opacity = Object.freeze({
2-
hidden: '0%',
32
sm: '24%',
43
disabled: '50%',
54
inactive: '62%',

packages/types/src/appearance.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ export type ElementsConfig = {
218218
otpCodeField: WithOptions;
219219
otpCodeFieldInputs: WithOptions;
220220
otpCodeFieldInput: WithOptions;
221+
otpCodeFieldInputContainer: WithOptions;
221222
otpCodeFieldErrorText: WithOptions;
222223

223224
dividerRow: WithOptions;

0 commit comments

Comments
 (0)