Преглед на файлове

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

satnaing преди 1 година
родител
ревизия
e6679cbed4
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  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)