From a7aa316b2dc0916b8f81314c47b02cb805c3e604 Mon Sep 17 00:00:00 2001 From: Anusha Date: Tue, 5 Nov 2024 12:29:31 +0500 Subject: [PATCH] fix blue border around year --- src/components/DatePicker/CalendarPicker/index.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/DatePicker/CalendarPicker/index.tsx b/src/components/DatePicker/CalendarPicker/index.tsx index 287ec3359175..9906f9b04c3c 100644 --- a/src/components/DatePicker/CalendarPicker/index.tsx +++ b/src/components/DatePicker/CalendarPicker/index.tsx @@ -1,6 +1,6 @@ import {addMonths, endOfDay, endOfMonth, format, getYear, isSameDay, parseISO, setDate, setYear, startOfDay, startOfMonth, subMonths} from 'date-fns'; import {Str} from 'expensify-common'; -import React, {useState} from 'react'; +import React, {useRef, useState} from 'react'; import {View} from 'react-native'; import PressableWithFeedback from '@components/Pressable/PressableWithFeedback'; import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback'; @@ -51,6 +51,7 @@ function CalendarPicker({ const themeStyles = useThemeStyles(); const StyleUtils = useStyleUtils(); const {preferredLocale, translate} = useLocalize(); + const pressableRef = useRef(null); const [currentDateView, setCurrentDateView] = useState(getInitialCurrentDateView(value, minDate, maxDate)); @@ -148,7 +149,11 @@ function CalendarPicker({ dataSet={{[CONST.SELECTION_SCRAPER_HIDDEN_ELEMENT]: true}} > setIsYearPickerVisible(true)} + onPress={() => { + pressableRef?.current?.blur(); + setIsYearPickerVisible(true); + }} + ref={pressableRef} style={[themeStyles.alignItemsCenter, themeStyles.flexRow, themeStyles.flex1, themeStyles.justifyContentStart]} wrapperStyle={[themeStyles.alignItemsCenter]} hoverDimmingValue={1}