-
-
Notifications
You must be signed in to change notification settings - Fork 159
Datepicker pops up in modal but auto close when click on anything in the datepick menu #22
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
Comments
I am aware of the issue with HeadlessUI, will check what is happening. Are you on the latest version of the Datepicker? |
@Jasenkoo Yes, v3.1.1. For now, My temporary solution is to use teleport but the problem is, the menu will appear off screen so I have to use |
@betaSavvy Tried to reproduce it with your example, however, without success, the modal is displayed like a sidebar, and the clicking is working fine. Your behavior might be happening because of the 2 teleports, one from the Dialog, and one from the datepicker. Can you set the Let me know if that works. Also, are you maybe using a fork of the repo? |
@Jasenkoo I have tried your suggestion to set an <Dialog @close="hide()"
as="div"
class="fixed inset-0 z-10 overflow-hidden">
<div id="container" class="absolute inset-0 overflow-hidden"> <!--- ID PLACE HERE FOR TELEPORT --> AND IT WORKS! (and it positions the picker menu correctly too so I no longer needs to do alt position) Thanks alot! |
Great, version 3.2 will include some adjustments where you wouldn't need to change the teleport target or add initial focus |
@Jasenkoo the same problem happens with Vuetify dialogs. When inside a dialog and clicking on anything in the Datepicker, it closes the dialog. How to fix this? |
@donmb1 What version are you using? Can you try setting the |
Same problem in Quasar popups (menu component, or pop-up proxy), https://codesandbox.io/s/withered-butterfly-72zfqp?file=/src/pages/Index.vue -- |
@Jasenkoo Vuetify |
@donmb1 Will take a look |
- refactor: add preventDefault on enter key when input is focused
@SvetlozarValchev I was facing the same issue (vuetify modal + teleport) |
@borisgraeff-pxo Thank you for the great input. Works like a charm (using it within Quasar dialogs, menus, ets..)! |
I am using headless ui for modal dialog and the date picker is inside the modal. Initial focus is already set on the focusable button. When I click on the date picker component, it pops up the menu just fine, when I start to click anything on it, it closes.
Any advise?
Script setup code:
Dialog(Modal) code:
The text was updated successfully, but these errors were encountered: