From a72578d991c7a141ac5be5f14f87bf703da8df66 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 focus when wrapper is clicked --- core/components/atoms/input/Input.tsx | 4 +- .../__snapshots__/Input.test.tsx.snap | 63 ++- .../atoms/metricInput/MetricInput.tsx | 9 +- .../__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 | 30 +- .../__tests__/__snapshots__/TS.test.tsx.snap | 6 +- css/src/components/input.css | 4 + css/src/components/metricInput.css | 4 + 14 files changed, 496 insertions(+), 234 deletions(-) diff --git a/core/components/atoms/input/Input.tsx b/core/components/atoms/input/Input.tsx index 07a8618f11..734d3af4ce 100644 --- a/core/components/atoms/input/Input.tsx +++ b/core/components/atoms/input/Input.tsx @@ -228,13 +228,15 @@ export const Input = React.forwardRef((props, forw ); return ( + // eslint-disable-next-line
ref.current?.focus()} - role="presentation" + role="textbox" onBlur={() => setIsInputBlank(!ref.current?.value)} + tabIndex={0} > {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 3a24c3bd39..09b0b34b88 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