Skip to content
This repository has been archived by the owner on Nov 11, 2017. It is now read-only.

fix click events re-propogation on mobile #189

Merged
merged 1 commit into from
Jan 19, 2015

Conversation

fivetanley
Copy link
Member

fixes GH-170

Previously, we did not fire a click event for touch events
on mobile unless the event target was a form field. This is
incorrect as the event was not preventDefault'd before.

As you can see on Lines 48-50 in https://github.com/emberjs/list-view/blob/0e596c9c629fa076e9089e787bb2e360b8efccb6/packages/list-view/lib/virtual_list_scroller_events.js#L48-50 (not the commit
that introduced the bug, just a hard link reference),
the "begin scroll" handler does not preventDefault
on the event if it is a form field, so we do not need
to re-propogate it in synthesizeClick.

All other tag types do need to synthesize the click
event on mobile however.

I ran the tests in the XCode simulator and they passed.

fixes emberjsGH-170

Previously, we did not fire a click event for touch events
on mobile unless the event target was a form field. This is
incorrect as the event was not `preventDefault`'d before.

As you can see on Lines 48-50 in 0e596c (not the commit
that introduced the bug, just a hard link reference),
the "begin scroll" handler does not preventDefault
on the event if it is a form field, so we do not need
 to re-propogate it in `synthesizeClick`.

All other tag types *do* need to synthesize the click
event on mobile however.

I ran the tests in the XCode simulator and they passed.
@fivetanley
Copy link
Member Author

Oh wow, guess my tired eyes missed #112 by @jmonma. Glad we came up with a similar fix though. :) cursor: pointer as @krisselden suggested in that PR does not make stuff like link-to etc work, so we need one of these PRs

stefanpenner added a commit that referenced this pull request Jan 19, 2015
fix click events re-propogation on mobile
@stefanpenner stefanpenner merged commit e726084 into emberjs:master Jan 19, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

virtual-list-view links do not work on iOS / Safari Mobile
2 participants