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
Menu panel swipe open close #606
Conversation
AquiGorka
commented
Feb 7, 2019
•
edited
edited
8b90bc6
to
36bc01c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! I left some comments.
I wonder if we should detect the touch capability before enabling this behavior? e.g. by checking 'ontouchstart' in document.documentElement
. We could also detect iOS and disable it there too, so users are not surprised to have it working one way (to close) but not the other.
Let me know what you think 😊
src/Wrapper.js
Outdated
(down && | ||
xDelta && | ||
yDelta > -THRESHOLD_DISTANCE && | ||
yDelta < THRESHOLD_DISTANCE && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s really weird, in your capture yDelta < THRESHOLD_DISTANCE
shouldn’t pass, since you are going below 10px
? But in any case, do we need this check at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what the checks for xDelta
and xDir
are for, to capture "intent" if the user started scrolling horizontally and triggered the open/close, then it doesn't matter if they do vertical movement and the other way around, if they do vertical movement then the drag does not start.
src/Wrapper.js
Outdated
yDelta < THRESHOLD_DISTANCE && | ||
xDir && | ||
yDir > -THRESHOLD_DIRECTION && | ||
yDir < THRESHOLD_DIRECTION) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure I understand why the Y part of the direction vector is tested, since we are testing the distance already? For example, users might want to drag the panel in a diagonal, and it should drag the panel anyway.
Or maybe the intention is to test the X velocity, and only start the drag if it is sufficient? In any case, I don’t think we should use one component of a direction vector to do that.
1df8dad
to
751f1a5
Compare
fec75ac
to
cb051d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✨ LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I just noticed; on the "native" apps, text selection via mouse click + movement is now impossible on desktop since the events are being picked up by the gesture instead :/.
Maybe this is something we should only enable on touch devices?
cb051d7
to
d404e1a
Compare
Adds update overlay to allow to swipe to open for iframe apps
272cf5d
to
47fce78
Compare
47fce78
to
c0535dc
Compare
c0535dc
to
1b8a7e9
Compare
* origin/master: (56 commits) Identity - Improve LocalIdentityBadge (#673) Menu panel footer separator (#666) fix(MenuPanel): avoid clickable margin above system apps toggle (#671) Local identities (#656) MenuPanel: add toggle animation to show/hide system apps (#658) Add github workflow for linting/building (#663) Permissions: added system and background app labels (#650) Use the same component to render every app icon (#655) chore: add all contributors and contributing guidelines (#649) Manage the menu button using messages + prevent re-mounting on resize (#651) Update melon (#647) Apps <> System apps separator (#648) Upgrade lint-staged (#646) fix: always leave Kernel as first app (#645) fix: avoid assigning a registry tag if app is not on a registry (#644) chore: upgrade @aragon/wrapper to v4.0.0-beta.1 (#639) DaoSettings: add bottom margin on app items (#638) Refactor common components (#615) Enforce MenuPanel’s width (#636) Menu panel swipe open close (#606) ...
* origin/master: (55 commits) Identity - Improve LocalIdentityBadge (#673) Menu panel footer separator (#666) fix(MenuPanel): avoid clickable margin above system apps toggle (#671) Local identities (#656) MenuPanel: add toggle animation to show/hide system apps (#658) Add github workflow for linting/building (#663) Permissions: added system and background app labels (#650) Use the same component to render every app icon (#655) chore: add all contributors and contributing guidelines (#649) Manage the menu button using messages + prevent re-mounting on resize (#651) Update melon (#647) Apps <> System apps separator (#648) Upgrade lint-staged (#646) fix: always leave Kernel as first app (#645) fix: avoid assigning a registry tag if app is not on a registry (#644) chore: upgrade @aragon/wrapper to v4.0.0-beta.1 (#639) DaoSettings: add bottom margin on app items (#638) Refactor common components (#615) Enforce MenuPanel’s width (#636) Menu panel swipe open close (#606) ...