From de16c5834f1a464fe473158172196176a91b5269 Mon Sep 17 00:00:00 2001 From: Satyam Chatterjee Date: Tue, 25 Jul 2023 17:58:35 +0530 Subject: [PATCH] fix(input): update input wrapper focus on padding click --- core/components/atoms/input/Input.tsx | 4 +- .../__snapshots__/Input.test.tsx.snap | 63 ++- .../atoms/metricInput/MetricInput.tsx | 10 +- .../__tests__/MetricInput.test.tsx | 13 + .../__snapshots__/MetricInput.test.tsx.snap | 12 +- .../__snapshots__/InputMask.test.tsx.snap | 3 +- .../__snapshots__/Pagination.test.tsx.snap | 3 +- .../VerificationCodeInput.test.tsx.snap | 504 ++++++++++++------ .../__snapshots__/DatePicker.test.tsx.snap | 3 +- .../DateRangePicker.test.tsx.snap | 72 ++- .../__snapshots__/TimePicker.test.tsx.snap | 24 +- .../__tests__/__snapshots__/TS.test.tsx.snap | 6 +- 12 files changed, 485 insertions(+), 232 deletions(-) diff --git a/core/components/atoms/input/Input.tsx b/core/components/atoms/input/Input.tsx index 1a959095e0..0f042866f7 100644 --- a/core/components/atoms/input/Input.tsx +++ b/core/components/atoms/input/Input.tsx @@ -228,8 +228,10 @@ export const Input = React.forwardRef((props, forw className={classes} style={{ minWidth }} onClick={() => ref.current?.focus()} - role="presentation" + //role is button to provide tab accessibility + role="button" onBlur={() => setIsInputBlank(!ref.current?.value)} + tabIndex={1} > {inlineLabel && (
diff --git a/core/components/atoms/input/__tests__/__snapshots__/Input.test.tsx.snap b/core/components/atoms/input/__tests__/__snapshots__/Input.test.tsx.snap index c6c015e081..1640a3bfda 100644 --- a/core/components/atoms/input/__tests__/__snapshots__/Input.test.tsx.snap +++ b/core/components/atoms/input/__tests__/__snapshots__/Input.test.tsx.snap @@ -8,8 +8,9 @@ exports[`Input component