amsul / pickadate.js

The mobile-friendly, responsive, and lightweight jQuery date & time input picker.
http://amsul.ca/pickadate.js
MIT License
7.7k stars 1.01k forks source link

Datepicker Editable Broken #1087

Closed craigpotter closed 5 years ago

craigpotter commented 6 years ago

Hi,

$('.datepicker').pickadate({ editable: true }); Clicking on the input does nothing.

I can provide a codepen if required however it is also broken on the documentation here

p8 commented 5 years ago

The same thing for the timepicker: https://codepen.io/anon/pen/dLdoOX

amsul commented 5 years ago

@craigpotter yup..and if you read further down, it says:

An important thing to note here is that this disables keyboard bindings on the input element, such as arrow keys opening the picker. You will have to add your own bindings as you see fit.

🙂

p8 commented 5 years ago

oops, sorry 🙃

craigpotter commented 5 years ago

@amsul I didn't think mouse clicks would class as keyboard bindings

amsul commented 5 years ago

I actually misread the initial report. I'm actually seeing a very odd behavior in the docs now.

@DanielRuf try opening the picker and then closing it again. It doesn't seem to close.

DanielRuf commented 5 years ago

Hm, is it due to the latest hotfix (bisect)? If so we should revert/patch it.

DanielRuf commented 5 years ago

https://github.com/amsul/pickadate.js/pull/1145

@colinhowe

Can you add unit tests for this and test the previous release?

colinhowe commented 5 years ago

That's an odd behaviour. I'll take a look as I definitely wouldn't have tested against the editable variant.

colinhowe commented 5 years ago

Using the codepen from @p8 suggests the bug was introduced between 3.6.0 and 3.6.1

p8 commented 5 years ago

yes, I noticed the problem when upgrading from e528acc to 3.6.2

DanielRuf commented 5 years ago

Hm, between .0 and .1 is just the Chrome 73 workaround.

https://github.com/amsul/pickadate.js/compare/3.6.0...3.6.1

DanielRuf commented 5 years ago

It's basically because of https://github.com/amsul/pickadate.js/blob/master/lib/picker.js#L363

I'll test if I have to remove my workaround.

DanielRuf commented 5 years ago

Seems so: https://codepen.io/DanielRuf/pen/YMLBqo

Sorry for that, I'll prepare a fix.

amsul commented 5 years ago

It should be fixed on master now with this fix: https://github.com/amsul/pickadate.js/pull/1158

DanielRuf commented 5 years ago

Closing as fixed.

AstghikMirijanyan commented 5 years ago

$('.datepicker').on('mousedown',function(event){ event.preventDefault(); });

DanielRuf commented 5 years ago

$('.datepicker').on('mousedown',function(event){ event.preventDefault(); });

Hi @AstghikMirijanyan,

did you already try the latest release? It should be fixed in 3.6.4. See http://amsul.ca/pickadate.js/date/#editable

AstghikMirijanyan commented 5 years ago

hello this code I worked fine and the calendar opens without problems

DanielRuf commented 5 years ago

hello this code I worked fine and the calendar opens without problems

Hi, can you clarify? Does the current 3.6.4 release work for you?

AstghikMirijanyan commented 5 years ago

hello this code I worked fine and the calendar opens without problems

Hi, can you clarify? Does the current 3.6.4 release work for you?

I am using materialize.js and there were problems, but pickadate.js did not connect

DanielRuf commented 5 years ago

I am using materialize.js and there were problems, but pickadate.js did not connect

Not completely sure what you mean. Materialize provides its own customized version of pickadate. You would have to directly change the files in Materialize.