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

Datepicker hangs at height:0 #183

Closed
Steinweber opened this issue Mar 24, 2024 · 3 comments
Closed

Datepicker hangs at height:0 #183

Steinweber opened this issue Mar 24, 2024 · 3 comments

Comments

@Steinweber
Copy link

When I click on the input field of the data picker, it opens normally. If I use the "Close" button, I can also open the date picker again.
But if I click outside the input field, the datepicker disappears, gets the class datepicker--closed, but keeps the style height:0 and does not get the value display: none. From this point on, the datepicker can no longer be opened. The classes change when it is opened, but the style height:0 means that nothing is displayed.

This can be fixed with a few lines. But I would like to fix the cause of the problem.

input.addEventListener('afterClose', (e) => {
        if(datepicker.datepicker.style.height !== null){
            datepicker.datepicker.style.height = null;
            datepicker.datepicker.style.display = 'none';
        }
    });
@benitolopez
Copy link
Owner

Is this something that happens in the demo?
https://lopezb.com/hoteldatepicker/

If so, can you give me more details? I haven't figured out how to reproduce the problem.
If not, please verify that you implemented the datepicker correctly and share the URL where I can see it in action

@Steinweber
Copy link
Author

I have found my mistake. With animationSpeed I assumed a number. If you put a number instead of the expected string, there is no error in the console, but the datepicker only opens once.

https://codepen.io/MaxDau/pen/ZEZyOON

@benitolopez
Copy link
Owner

Ok, then, I'll close this. As per documentation, that option requires a string: https://github.com/benitolopez/hotel-datepicker?tab=readme-ov-file#animationspeed

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