Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Left Nav] Fix left nav opening on click #998

Merged
merged 1 commit into from
Jul 2, 2015

Conversation

pomerantsev
Copy link
Contributor

Fixes #997

@pomerantsev pomerantsev changed the title Fix left nav opening on click [Left Nav] Fix left nav opening on click Jun 30, 2015
@cgestes
Copy link
Contributor

cgestes commented Jul 1, 2015

Hi pomerantsev,

Thank you for the fix.
But does not seem to work on my phone. (android) (no swiping at all can be observed with the patch)

@pomerantsev
Copy link
Contributor Author

@cgestes: if you're sure the issue has been introduced by this patch, could you please describe it in more detail?
Swiping works fine for me in Chrome on Google Nexus 5 and Samsung Galaxy S5, and in Safari on an iPod 5.
Swiping does not work perfectly though in the Android stock browser on the Samsung Galaxy S5 (you have to be sure while swiping left or right that you haven't moved up or down at all), and it probably has to do with constants (how far you should swipe to consider it a gesture). I will make a separate issue for this.
But I wonder how this could have anything to do with the patch, since I've only changed code in the touchend handler.

@cgestes
Copy link
Contributor

cgestes commented Jul 2, 2015

I'am using it in cordova. (galaxy s4 mini).

will try in Chrome.

The issue is simple: it doesn't do anything, which is much better than the previous crazyness :)

I plan to spend some time debugging material-ui on the phone. (swiping, ListItem ripple, ..)

So it's better with the patch.

@cgestes
Copy link
Contributor

cgestes commented Jul 2, 2015

it's working in Chrome on my phone :)

@cgestes
Copy link
Contributor

cgestes commented Jul 2, 2015

same for the ListItem!

I will have to debug what happens with the default browser. (android 4.4)

@pomerantsev
Copy link
Contributor Author

Okay, cool.
@hai-cea: looks like @cgestes approves this PR :).
@cgestes: I'm going to take a look at what's going on in the stock browser, but it won't happen until Sunday. If you narrow it down before that, please feel free to submit an issue, and I'll be happy to fix it.

@hai-cea
Copy link
Member

hai-cea commented Jul 2, 2015

Thanks @pomerantsev @cgestes !

hai-cea added a commit that referenced this pull request Jul 2, 2015
[Left Nav] Fix left nav opening on click
@hai-cea hai-cea merged commit 230df2b into mui:master Jul 2, 2015
@pomerantsev pomerantsev deleted the fix/swipe-to-open branch July 2, 2015 19:14
@pomerantsev
Copy link
Contributor Author

@cgestes: I spent some time trying to figure out what was causing the issue. Now I think I understand what's going on, but I still don't have a solution.
The stock Android browser on my Samsung Galaxy S5 reports that it's based on Chrome 34, and the way touch events behave changed in Chrome 35: http://lists.w3.org/Archives/Public/public-touchevents/2014Mar/0000.html
Thing is, prior to version 35, as soon as the page fires a scroll event, a touchcancel event also fires, and all subsequent touch events are suppressed.
We could call e.preventDefault() between these two lines, and swiping would work fine, but then the page wouldn't scroll at all (looks like this way scroll events are suppressed), so this is not a solution.
Summary: this bug is not critical (users can still use clicks to close the nav), and fixing it seems like a major pain, so I'll leave it as it is.
Feel free to open a new issue if there's anything I haven't addressed here.

@cgestes
Copy link
Contributor

cgestes commented Jul 10, 2015

@pomerantsev thanks for the investigation.

@zannager zannager added the docs Improvements or additions to the documentation label Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[LeftNav] can be opened by clicking anywhere on the page
4 participants