react-kronos icon indicating copy to clipboard operation
react-kronos copied to clipboard

Prevent bubbling of click events

Open Wartybliggens opened this issue 6 years ago • 0 comments

A big problem I have run into with react-kronos is that click events escape, since kronos does not use event.preventDefault() for clicks on the date chooser dropdown.

Imagine this scenario:

  • A modal overlay with a form in it, including react-kronos.
  • The modal is set up so that clicks outside the modal auto-close it.
  • When the user clicks on the react-kronos dropdown (since it's an absolutely-positioned div, not a child of the modal), it counts as an outside click, so the modal closes. Sorry!

I imagine it would be a pretty simple changeset to address this. At some point I may try and do a pull request if you don't get to it.

Wartybliggens avatar Jun 28 '18 19:06 Wartybliggens