Skip to content

Conversation

RSO
Copy link
Contributor

@RSO RSO commented Jul 8, 2014

onMouseDown is actually triggered before blur in at least Firefox and Chrome. IE test is still needed.

This way we no longer need the ugly and flaky setTimeout (only one left to defer the focus for Firefox).

Fixes #28

…Down

onMouseDown is actually triggered *before* blur in at least Firefox and Chrome. IE test is still needed.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found this suggestion at http://facebook.github.io/react/tips/communicate-between-components.html and I liked it! It seems similar to the following Coffeescript we use at HackerOne:

handleClick: (item) -> =>
  @setState clicked: item
render: ->
  div onClick: @handleClick(item)

What do you guys think?

@michiel3
Copy link
Contributor

michiel3 commented Jul 8, 2014

IE test is still needed.

I can confirm that this behaves as expected in IE. Cool!

martijnrusschen pushed a commit that referenced this pull request Jul 8, 2014
Replace onClick with onMouseDown
@martijnrusschen martijnrusschen merged commit 04bf9dc into master Jul 8, 2014
@martijnrusschen martijnrusschen deleted the remove-timeout branch July 8, 2014 07:16
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

Successfully merging this pull request may close these issues.

Clicking on a day causes the datepicker to close without selecting

3 participants