nathanreyes / v-calendar

An elegant calendar and datepicker plugin for Vue.
https://vcalendar.io
MIT License
4.32k stars 840 forks source link

positionFixed is not included in PopoverOptions as expected #1377

Open kloo012 opened 10 months ago

kloo012 commented 10 months ago

Hi everyone! I recently upgraded from v-calendar 2.3.4 to 3.0.3 and am also now using TypeScript in my codebase. My datepicker formerly used positionFixed: true so the calendar appeared visually on top of all elements in a parent container with overflow: hidden; set. The implementation looked like this:

<date-picker :popover="popoverAttributes">
 const popoverAttributes = {
    visibility: 'focus',
    positionFixed: true,
}

In v-calendar v2 we could bind popover settings directly to the component with a :popover prop as seen above. The v3 docs don't seem to mention the popover prop or positionFixed as part of the new API at all. BUT the above still works in v3! This is great news. My only problem is that the component now throws a typescript error because positionFixed is no longer included in PopoverOptions as it once was.

When I look into the Datepicker component, I noticed this positionFixed value is still being accounted for: https://github.com/nathanreyes/v-calendar/blob/master/src/components/Popover.vue#L76 https://github.com/nathanreyes/v-calendar/blob/master/src/components/Popover.vue#L104 etc...

This makes me think PopoverOptions should still account for positionFixed, at the very least. Proposal to add it back? Right now I am having to extend the PopoverOptions type to include positionFixed, and it would be a bit more seamless to have it as part of the type that comes from this library!