Skip to content
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

Trigger automatically when input is focused #32

Open
YANOUSHek opened this issue Jul 16, 2024 · 2 comments
Open

Trigger automatically when input is focused #32

YANOUSHek opened this issue Jul 16, 2024 · 2 comments

Comments

@YANOUSHek
Copy link

Hi. I was trying to get the calendar to work automatically without a specified toggle. There's a couple small places where the toggle is required (missing checks for hasToggleTarget). But after that, when I added data-action="focus->datepicker#toggle" to my input the calendar steals the focus and disappears.

Trying to get this working myself I wasted quite some time that I can't really spare right now. Would you be willing to add this option to the datepicker? So it isn't triggered explicitly by clicking the toggle but automatically when the input field it's attached to is focus (but still leaving the option to enter the date using the keyboard)?

I might find some time for this later but I'm not really sure.

@airblade
Copy link
Owner

How about if you keep the toggle but hide it; and when the input receives the focus, trigger a click on the toggle? You might also have to focus the input again.

...time that I can't really spare right now.

I don't have any time available at the moment I'm afraid.

@YANOUSHek
Copy link
Author

Fixing the requirement for having a trigger was the easy part, but then having the calendar work without having focus turned out to be a hard thing. I'll try and find some time for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants