Skip to content

Commit 896cd0a

Browse files
borntofrappeapollonian
authored andcommitted
modify aria-label with instructive text
1 parent 521f9fc commit 896cd0a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib/index.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ class SingleOtpInput extends PureComponent<*> {
8484
disabledStyle,
8585
shouldAutoFocus,
8686
isInputNum,
87+
index,
8788
value,
8889
className,
8990
...rest
@@ -95,7 +96,7 @@ class SingleOtpInput extends PureComponent<*> {
9596
style={{ display: 'flex', alignItems: 'center' }}
9697
>
9798
<input
98-
aria-label={`Verification code ${isInputNum ? 'digit' : 'character'}`}
99+
aria-label={`${(index === 0) ? 'Please enter verification code. ' : ''}${isInputNum ? 'Digit' : 'Character'}${index + 1}`}
99100
autoComplete="off"
100101
style={Object.assign(
101102
{ width: '1em', textAlign: 'center' },
@@ -298,6 +299,7 @@ class OtpInput extends Component<Props, State> {
298299
<SingleOtpInput
299300
placeholder={placeholder && placeholder[i]}
300301
key={i}
302+
index={i}
301303
focus={activeInput === i}
302304
value={otp && otp[i]}
303305
onChange={this.handleOnChange}

0 commit comments

Comments
 (0)