You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I'd like to propose an improvement to the alt-position prop.
The issue
When using 'teleport' together with the alt-position prop and calculating the position of the datepicker, we have no way to change the position of an arrow (besides overwriting it's css)
This happens because the position of the arrow is determined by the following parameter:
By default it's value is changed here in the calculateMenuPosition, however, when using alt-position, this property is set to default, which makes the arrow always point upwards.
This change will allow more flexibility for setting up custom positions for the calendar content.
Workaround
The workaround I found is to overwrite the css of dp__arrow_top class for the arrow to point in the correct dirrection. This is not ideal, because I will have to do a side effect inside the function I'm passing to the alt-position prop.
Screenshot for more context
The text was updated successfully, but these errors were encountered:
Hello! I'd like to propose an improvement to the alt-position prop.
The issue
When using 'teleport' together with the alt-position prop and calculating the position of the datepicker, we have no way to change the position of an arrow (besides overwriting it's css)
This happens because the position of the arrow is determined by the following parameter:
vue-datepicker/src/VueDatePicker/composables/position.ts
Line 48 in efcecf3
By default it's value is changed here in the
calculateMenuPosition
, however, when using alt-position, this property is set to default, which makes the arrow always point upwards.vue-datepicker/src/VueDatePicker/composables/position.ts
Lines 113 to 129 in efcecf3
Solution
My suggestion is to change the
customAltPosition
method to allow users to provide their own value ofopenOnTop
parameter:Then, on the level of a project we'll just need to do the following:
This change will allow more flexibility for setting up custom positions for the calendar content.
Workaround
The workaround I found is to overwrite the css of
dp__arrow_top
class for the arrow to point in the correct dirrection. This is not ideal, because I will have to do a side effect inside the function I'm passing to thealt-position
prop.Screenshot for more context
The text was updated successfully, but these errors were encountered: