Skip to content

Commit 10fbfed

Browse files
authored
Merge pull request #901 from carlssonemil/fix-arrow-pos-safe-navigation
fix: Add safe navigation to arrow position calculation
2 parents fd2efbf + fbcca2a commit 10fbfed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/VueDatePicker/components/DatepickerMenu.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@
249249
if (defaultedConfig.value.arrowLeft) return defaultedConfig.value.arrowLeft;
250250
const menuRect = dpMenuRef.value?.getBoundingClientRect();
251251
const inputRect = props.getInputRect();
252-
if (inputRect.width < calendarWidth.value && inputRect.left <= (menuRect?.left ?? 0)) {
253-
return `${inputRect.width / 2}px`;
252+
if (inputRect?.width < calendarWidth?.value && inputRect?.left <= (menuRect?.left ?? 0)) {
253+
return `${inputRect?.width / 2}px`;
254254
}
255255
return '50%';
256256
});

0 commit comments

Comments
 (0)