qodesmith / datepicker

Get a date with JavaScript! A datepicker with no dependencies.
344 stars 101 forks source link

Readonly field trigger click event #54

Closed cebindani closed 5 years ago

cebindani commented 5 years ago

We have a following problem: set a input as disabled does accessibility ignores the field. To avoid this, I set input field as readonly, but click event still open datepicker. That's a way to remove a click listener by demand, without remove datepickers instance?

qodesmith commented 5 years ago

Thanks for your patience. Just settled down in a new job so I'll be spending some time on resolving bugs.

qodesmith commented 5 years ago

Hey @cebindani, I'm not sure I understand. Are you saying that when you set an input to disabled - <input disabled /> - that you want to make sure the calendar doesn't open?

cebindani commented 5 years ago

The problem is when I set input as readonly the calendar should not open.

qodesmith commented 5 years ago

Ahhh, I see what you're saying. Ok, let me look into this.

qodesmith commented 5 years ago

@cebindani Done! The new feature you'll want to use is respectDisabledReadOnly. Set it to true and you should be good to go.

qodesmith commented 5 years ago

Clarification... the calendar opens, but it is unable to select a date or change the value of the input. Hence the readonly part.

qodesmith commented 5 years ago

UPDATE: I just added the disabled feature. Feel free to use that as well.