Vuepic / vue-datepicker

Datepicker component for Vue 3
https://vue3datepicker.com
MIT License
1.38k stars 137 forks source link

fix: Arrow not positioned correctly when the field at the most right #923

Closed allusernamestakenexceptthis closed 1 week ago

allusernamestakenexceptthis commented 2 weeks ago

this is a fix for issue https://github.com/Vuepic/vue-datepicker/issues/920

the bug:

the popup arrow is not pointing to the center of the field, when the field is on the right most of the area and there is not enough screen width to center the popup. This issue seems solved only when it is on the left via issue https://github.com/Vuepic/vue-datepicker/issues/802.

the fix:

I added check for the right side. if there is not enough width, then position arrow to middle of input.

tests

done, no issue locally. but pull request showing one failed test.
npm run test:coverage and npm run test works fine locally

proof

Screenshot 2024-06-25 09 55 36 msedge GGO

and it works for other situations, left and default Screenshot 2024-06-25 09 55 56 msedge 8a1 Screenshot 2024-06-25 09 53 59 msedge cF9