Skip to content

Commit

Permalink
Merge pull request #6480 from lehuuphuc/fix/datepicker-wrong-element-…
Browse files Browse the repository at this point in the history
…focused

Fix: focus on wrong element when adding "Select" component to footer slot of DatePicker
  • Loading branch information
tugcekucukoglu authored Sep 26, 2024
2 parents b01ba64 + 8aeccb6 commit 8a2c710
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/primevue/src/datepicker/DatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2549,7 +2549,10 @@ export default {
let spanIndex = null;
for (let i = 0; i < focusableElements.length; i++) {
if (focusableElements[i].tagName === 'SPAN') spanIndex = i;
if (focusableElements[i].tagName === 'SPAN') {
spanIndex = i;
break;
}
}
focusableElements[spanIndex].focus();
Expand Down

0 comments on commit 8a2c710

Please sign in to comment.