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

Disabled property does not work #133

Open
jvlobo opened this issue Nov 29, 2022 · 3 comments
Open

Disabled property does not work #133

jvlobo opened this issue Nov 29, 2022 · 3 comments

Comments

@jvlobo
Copy link
Contributor

jvlobo commented Nov 29, 2022

According to the documentation, there is a property called disabled for disabling the entire calendar -> https://github.com/qodesmith/datepicker#disabled

I've tried to use it but it doesn't seem to be working.
Here I tried to do it on the sandbox.js file of this repository:

Disabled.prop.not.working.mov

Am I missing something or it is actually an issue?

Thank you!

@qodesmith
Copy link
Owner

So this is admittedly confusing. Don't pass the disabled property to the options. Rather, add it to the picker instance like this:

window.single = datepicker('input', {alwaysShow: 1})

// Now add the property to the instance.
window.single.disabled = true

I don't remember why I didn't just pass on the disabled property to the instance, but for now this should work.

@jvlobo
Copy link
Contributor Author

jvlobo commented Nov 29, 2022

Thanks for the quick reply.

So, what it does, it does not show the calendar when you click the input, right? I thought it would still show it but with everything disabled (not clickable and with different colors to show it is disabled)

@qodesmith
Copy link
Owner

Yea, I saw that in the code recently too. I'm looking to give the library a complete rewrite. Ideally, the disabled property should be passed into the options at declaration time and it should just disabled the calendar functionality, but still let you show / hide it. That will take me a bit of time as I'm trying to figure out some TypeScript things.

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