Rudeg / react-input-calendar

http://rudeg.github.io/react-input-calendar/
MIT License
139 stars 94 forks source link

Every click's default is prevented #100

Closed xavibonell closed 8 years ago

xavibonell commented 8 years ago

Hi, I've been working with this library, and it worked out very well so far, except for a couple of issues that got in my way. One of those is the fact that wherever I instantiate the class it will capture all document clicks and prevent their default. I have to say that I modified the library a bit to bend it to my app layout's requirements, but I'm pretty sure this behaviour is still present in this module repository. This issue obviously disables many things, I realised cause my labels stopped focusing their inputs after instantiating the calendar, but preventing every single document click is a very bold decision.

Anyway, it might be just me, but if someone else comes across this issue, solution is pretty easy, just delete e.preventDefault(); from this.documentClick = function (e) (index.js line 266 aprox)

kjs3 commented 8 years ago

Hit the same problem when using <button type='submit' />. Just remove e.preventDefault() and everything is fine.

Update: I submitted a PR for this. https://github.com/Rudeg/react-input-calendar/pull/103

Rudeg commented 8 years ago

Fixed, thanks @kjs3