Khan / structured-blocks

MIT License
11 stars 2 forks source link

Touch gestures in the toolbox get swallowed by Safari #18

Closed jbrennan closed 9 years ago

jbrennan commented 9 years ago

When you try to drag a block from the toolbox in Safari for iPad, the app tends to swallow the touches for its “go back” gesture. Quelle domage :cry:

According to this stackoverflow post there’s no way to disable it directly (maybe @andymatuschak knows a way?)

One thing we could do, although it’s a hack, is just make sure we always show the editor in a new tab (yuck) but that way there’s no “back” history, so there’s nothing to swipe back to.

andymatuschak commented 9 years ago

No way to disable it argh sorry!!!

You could open a new tab for the block editor so there's nowhere to go back to

On Mon, Nov 10, 2014 at 2:20 PM, Jason Brennan notifications@github.com wrote:

When you try to drag a block from the toolbox in Safari for iPad, the app tends to swallow the touches for its “go back” gesture. Quelle domage :cry: According to this stackoverflow post there’s no way to disable it directly (maybe @andymatuschak knows a way?)

One thing we could do, although it’s a hack, is just make sure we always show the editor in a new tab (yuck) but that way there’s no “back” history, so there’s nothing to swipe back to.

Reply to this email directly or view it on GitHub: https://github.com/Khan/structured-blocks/issues/18

jeresig commented 9 years ago

Seemingly the two other ways to disable it are to include the <meta name="apple-mobile-web-app-capable" content="yes"> tag and get them to add it to their home screen -- or us just making a light app wrapper and putting it on the app store.

Beyond that it may be worthwhile to consider UI changes that we may want to implement to prevent this from happening (since if they're on an iPad, and using us in Safari, they'll almost certainly hit this issue). Maybe the idea I mentioned before of putting the toolbox in the middle might help here (since you'll be dragging from the middle to the left, instead of from the left to the middle).

jeresig commented 9 years ago

My understanding of the problematic interaction in iOS Safari is that swiping left (from the near edge of the page), when you have a previous page in your tab's history, that it will cause that swipe interaction to occur. Assumedly the same would happen from the right when you have a page forward in your history. To me it seems like this would be far less likely to happen.

To work around this I just flipped the interface, which seems like it would work just as well in either case. Thoughts?

Flipped editor screenshot

jbrennan commented 9 years ago

I definitely don’t love it (that the browser is forcing our hand here :stuck_out_tongue_closed_eyes: ) but I think for now it might be the lesser of evils. The thing with opening it in a new tab is hopefully the user is progressing through many lessons and challenges, and we don’t want to open a new tab for every step.