kenhyuwa / litepie-datepicker

Litepie Datepicker is a date range picker component for Vue.js and Tailwind CSS, dependent to day.js.
https://litepie.com
MIT License
373 stars 75 forks source link

Calendar doesn't get trigger while loading inside `Portal` #54

Open jimbatamang opened 2 years ago

jimbatamang commented 2 years ago

When this date-picker get used inside modal which renders inside portal (teleport: https://v3.vuejs.org/guide/teleport.html), the show and hide method doesn't get triggered. Which means, the calendar will not appear.

gecas commented 2 years ago

+1

gecas commented 2 years ago

@jimbatamang did you manage to solve it somehow?

jimbatamang commented 2 years ago

Well yes I did but with bit custom way. I noticed that the library has show() method, so I end up adding ref to the calendar component and calling that method direclty from my component. You can also hide it with same way. The method is called hide().

My code looks like this:

const showCalendar = () => { datepicker.value.show() }

const hideCalendar = () => { datepicker.value.hide() }

gecas commented 2 years ago

@jimbatamang can you maybe send me an example of your component with more context, not really sure where to put the code

gecas commented 2 years ago

Nah, no need, managed to make it work