From 8aeccb6ad5d91dfe89c1fc8ff6019247ab52a07c Mon Sep 17 00:00:00 2001 From: Phuc Le Date: Thu, 26 Sep 2024 10:45:15 +0700 Subject: [PATCH] fix: focus on wrong element --- packages/primevue/src/datepicker/DatePicker.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/primevue/src/datepicker/DatePicker.vue b/packages/primevue/src/datepicker/DatePicker.vue index 90fc85680..a7308bed3 100755 --- a/packages/primevue/src/datepicker/DatePicker.vue +++ b/packages/primevue/src/datepicker/DatePicker.vue @@ -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();