-
-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use more than 1 instance of calendar with mouse event handlers on the same page #397
Comments
Hey! I'm facing the same problem for months. Any tips on how you have disabled? I have two instances of the Whenever the filter containing the |
In my case I needed only 1 calendar at a time so I used v-if condition to render only 1 (before it was using css display). it will not work in your case since you need both at the same time. |
I would use a different component for the filter e.g qdate |
I've also faced this problem recently. Any solutions? I'm using QCalendarMonth as a date picker and using QDate or any other similar component wouldn't be a wise solution in my case, especially because I like what I can do with QCalendar to make a fully custom date picker. |
@FCardeira Nope, I'm considering other Calendar solution like SyncFusion (waiting them migrate to Vue 3). |
I am stumbling over this same issue right now. |
Does anyone know whether this may ever be resolved? I actually have to use two separate QCalendars next to each other, each with their own data, so I actually need to be able to distinguish editing events in one or the other on the same page. |
+1 |
I came up with a workaround, since the events did fire from both calendars, they just both came from the component that contained the calendar which was last to render. So, say I wanted to add an event in the left calendar and clicked there, the event fired with the correct time and date from the component that contained the correct calendar, but it was being handled by the component that contained the wrong calendar. My solution was to give both calendars different id's (for ex. id="left" and id="right"), then I can use the MouseEvent that fired to recursively iterate through the .target attributes, whilst checking for which id eventually came up as the correct parent element. I hope this may help someone with similar issues! |
For everyone with the same problem: |
I am initiating several calendar instances (QCalendarDay and QCalendarAgenda) on different components.
It seems that mouse event handlers defined in 1 component overrun those of the others, making this usage scenario not usable.
I debugged this issue and examined the code and noticed that useMouse composable included a global $listeners variable that is getting overrun by each initiation of a calendar instance. This is the reason why event handlers stopped working on one of my calendar instances. After disabling all but 1, mouse event handlers started to work.
The text was updated successfully, but these errors were encountered: