From efec5640eef21b70e58807b9f90f394b4405344c Mon Sep 17 00:00:00 2001 From: Avijit Das Date: Thu, 16 May 2024 14:12:03 +0530 Subject: [PATCH] UXPLATFORM-10400 DatePicker focus fixed for mobile view --- packages/terra-date-picker/src/DatePicker.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/terra-date-picker/src/DatePicker.jsx b/packages/terra-date-picker/src/DatePicker.jsx index f3482278dfa..6c0c5e0d432 100644 --- a/packages/terra-date-picker/src/DatePicker.jsx +++ b/packages/terra-date-picker/src/DatePicker.jsx @@ -258,7 +258,6 @@ class DatePicker extends React.Component { if (this.props.onSelect) { this.props.onSelect(event, selectedDate.format(DateUtil.ISO_EXTENDED_DATE_FORMAT)); } - if (!this.props.disableButtonFocusOnClose) { // Allows time for focus-trap to release focus on the picker before returning focus to the calendar button. setTimeout(() => { @@ -275,6 +274,11 @@ class DatePicker extends React.Component { } handleOnClickOutside(event) { + setTimeout(() => { + if (this.calendarButton) { + this.calendarButton.focus(); + } + }, 100); if (this.props.onClickOutside) { this.props.onClickOutside(event); }