-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Dialogs closing immediately after opening since 1.6.0 when opened through FullCalendar handler #1647
Comments
Thanks for opening the issue! This happened due to browser event firing order and attempts to work around browser issues. 😅 We switched to using What used to happen:
What now happens:
You can see that here (you can ignore the error — I was just using it to grab a stack trace): I got this list by attaching a handful of event handlers to window before Headless UI put any on the window and using DevTools to add logging in a few spots. I'll discuss this internally because it's definitely not ideal but I'm not sure what options we have at the moment that won't cause other kinds of breaks but we'll definitely look into what we can do to fix this. In the mean time you can work around this by changing your implementation to wait until after the click event is done to open the dialog using |
Thank you @thecrypticace for your elaborate explanation and your suggested workaround. I will give that a shot and hopefully be able to update to 1.6 again :) Edit: works like a charm 👍 thanks. |
Thank you! |
What package within Headless UI are you using?
@headlessui/vue
What version of that package are you using?
1.6.5
What browser are you using?
Chrome
Reproduction URL
This is the example for @headlessui/vue version
1.5
where it works fine. When you click in the calendar, the dialog opens.Code Sandbox for FullCalender with Headless UI 1.5.0
Since 1.6.0, this is the behaviour:
Code Sandbox for FullCalender with Headless UI 1.6.5
Describe your issue
Since 1.6
@close
is immediately triggered on render when opening the modal through an event triggered by FullCalendar.In the first sandbox above, the modal opens when you press the button at the top. As expected. The modal can also be opened by clicking in the calendar. This works fine as well.
In the second example (with
@headlessui/vue
1.6.5
) the modal opens just fine when clicking the button. But when you click in the calendar, the modal opens and closes immediately because@close
is triggered.Maybe I'm using something in a way it's not supposed to be used, but this worked fine till
1.6.5
:(The text was updated successfully, but these errors were encountered: