From d8d5e93fca7fac0717a53ef646b5005e1f262be0 Mon Sep 17 00:00:00 2001 From: Mukul Bansal Date: Tue, 5 Nov 2024 01:02:44 +0530 Subject: [PATCH] fix: time highlight issue in timepicker affects: @medly-components/core, @medly-components/forms --- .../TimePicker/TimePickerPopup/TimePickerPopup.tsx | 1 + .../TimePicker/__snapshots__/TimePicker.test.tsx.snap | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/core/src/components/TimePicker/TimePickerPopup/TimePickerPopup.tsx b/packages/core/src/components/TimePicker/TimePickerPopup/TimePickerPopup.tsx index e5a1088a2..ec9dd325a 100644 --- a/packages/core/src/components/TimePicker/TimePickerPopup/TimePickerPopup.tsx +++ b/packages/core/src/components/TimePicker/TimePickerPopup/TimePickerPopup.tsx @@ -73,6 +73,7 @@ export const Component: FC = ({ hour = Number(time[0]); minutes = Number(time[1]); period = hour < 12 ? 0 : 1; + setValues({ hour, minutes, period }); } const height = (hourRef.current?.scrollHeight || 1) / 16; const hourScroll = hour % 12 === 0 ? 11 : (hour % 12) - 1; diff --git a/packages/core/src/components/TimePicker/__snapshots__/TimePicker.test.tsx.snap b/packages/core/src/components/TimePicker/__snapshots__/TimePicker.test.tsx.snap index 4c9350374..ec2407744 100644 --- a/packages/core/src/components/TimePicker/__snapshots__/TimePicker.test.tsx.snap +++ b/packages/core/src/components/TimePicker/__snapshots__/TimePicker.test.tsx.snap @@ -951,7 +951,7 @@ exports[`TimePicker should render properly 1`] = `
  • 10
  • @@ -990,7 +990,7 @@ exports[`TimePicker should render properly 1`] = ` />
  • 00
  • @@ -1056,7 +1056,7 @@ exports[`TimePicker should render properly 1`] = `
  • 11
  • @@ -1371,13 +1371,13 @@ exports[`TimePicker should render properly 1`] = ` />
  • AM
  • PM