Skip to content

Conversation

@fraserxu
Copy link
Contributor

@fraserxu fraserxu commented Jan 4, 2015

  • For the option, I add an onClick event
  • For the clear button, I add an onClick event
  • For the wrapper, I add an onTouchEnd event
  • For the Value.js, I add an onTouchEnd event

Copy link
Owner

Choose a reason for hiding this comment

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

Shouldn't the onClick handler still fire here on a touch device? or is it blocked by the onMouseDown handler?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I tested, the onClick does not fire on a touch device.

Add the onTouchEnd will make it work.

I also tried to change the onTouchEnd handler to

onTouchHanlder: function(e) {
  this.blockEvent(e)
  this.props.onRemove()
}

to prevent the input filed from focusing, but seems not work.

@JedWatson
Copy link
Owner

Thanks @fraserxu. I was initially concerned that binding both mouseDown and onClick to the same event handler might cause it to incorrectly fire twice for desktop users, but it may not be an issue... can you confirm this is correct?

@fraserxu
Copy link
Contributor Author

fraserxu commented Jan 4, 2015

Hi @JedWatson I checked the mouseDown and onClick on desktop, it will only fire once even after I added the onTouchEnd listener.

Till now all seems work well for me.

@JedWatson
Copy link
Owner

Cool. I'll merge it now so we can finally support mobile devices.

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.

2 participants