Przeglądaj źródła

fix(a11y): update default aria-label of each pin-input

satnaing 1 rok temu
rodzic
commit
e6679cbed4
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      src/components/custom/pin-input.tsx

+ 3 - 1
src/components/custom/pin-input.tsx

@@ -158,7 +158,9 @@ const PinInput = React.forwardRef<HTMLDivElement, PinInputProps>(
           autoComplete: otp ? 'one-time-code' : 'off',
           disabled: disabled,
           readOnly: readOnly,
-          'aria-label': ariaLabel,
+          'aria-label': ariaLabel
+            ? ariaLabel
+            : `Pin input ${counter} of ${length}`,
           ref: (node: HTMLInputElement | null) => {
             if (node) {
               refMap?.set(pinIndex, node)