Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
UXPLATFORM-10400 DatePicker focus fixed for mobile view
Browse files Browse the repository at this point in the history
  • Loading branch information
Avijit Das committed May 16, 2024
1 parent 2f632db commit efec564
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/terra-date-picker/src/DatePicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand All @@ -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);
}
Expand Down

0 comments on commit efec564

Please sign in to comment.