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

virtual-list-view links do not work on iOS / Safari Mobile #170

Closed
Genkilabs opened this issue Oct 1, 2014 · 6 comments · Fixed by #189
Closed

virtual-list-view links do not work on iOS / Safari Mobile #170

Genkilabs opened this issue Oct 1, 2014 · 6 comments · Fixed by #189

Comments

@Genkilabs
Copy link

You can see this easily by running an in-browser iOS emulator (I used chrome) and navigating to the list-view demo page, then changing one of the Virtual List View items to a link and trying to click it.
Here is a screenshot http://screencast.com/t/xSfKXJ2E0Ll9

I believe this might be a bug in the Zynga Scroller, perhaps related to pbakaus/scroller#40

I'm really just documenting it here for others looking for info on the issue, and to perhaps open up discussion of workarounds or other scroller options. Any thoughts?

@stefanpenner
Copy link
Member

can you try explicitly adding a { pointer:cursor; } to you a css

@Genkilabs
Copy link
Author

No luck. I am doing something like this:

{{#collection Ember.VirtualListView contentBinding="controller" height=661 rowHeight=82 width=320}}
    {{#link-to 'news-articles.show' this classNames="cursor-pointer"}}
        <h1 class="truncate">{{{title}}}</h1>
        <p class="truncate author">{{#if author}}By: {{author}}{{/if}}</p>
        <data class="truncate">{{from-now published}}</data>
    {{/link-to}}
{{/collection}}

and of course

.cursor-pointer{
    cursor: pointer;
}
a { pointer:cursor; }

Works great on all my browsers but iOS.

@stefanpenner
Copy link
Member

@lukemelia @krisselden @raycohen seen anything like this in our apps?

@Genkilabs
Copy link
Author

I should point out I also tested this on ember-cli-cordova and experienced this in both the xcode/emulator environment and when pushed onto an iPad, as well as in the regular mobile safari.

Does anyone by chance have an example up that uses virtual-list-view with working links I could look at?

@fivetanley
Copy link
Member

@Genkilabs any luck?

@Genkilabs
Copy link
Author

Nope, I ended up giving up on the list-view projects and rendering full lists then wrapping them in https://github.com/eviltrout/ember-cloaking

This seems to perform even better on desktop, and also works on iOS through ember-cli-cordova

fivetanley pushed a commit to fivetanley/list-view that referenced this issue Jan 19, 2015
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.
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 a pull request may close this issue.

3 participants