Skip to content

Commit

Permalink
check datepicker element is exist before click
Browse files Browse the repository at this point in the history
  • Loading branch information
anishkumar-bhut committed Dec 1, 2024
1 parent f0ee7d4 commit 64ad379
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export const useDateTimePickerFocus = (datePickerElem) => {
if (datePickerElem) {
if (focusOnFirstField && document.querySelector('#datetimepicker-date-picker-input-start')) {
document.querySelector('#datetimepicker-date-picker-input-start').click();
} else if(document.querySelector('#datetimepicker-date-picker-input-end')) {
} else if (document.querySelector('#datetimepicker-date-picker-input-end')) {
document.querySelector('#datetimepicker-date-picker-input-end').click();
}
}
Expand Down

0 comments on commit 64ad379

Please sign in to comment.