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

Gesture issues #7075

Closed
12 tasks
manucorporat opened this issue Jun 27, 2016 · 4 comments
Closed
12 tasks

Gesture issues #7075

manucorporat opened this issue Jun 27, 2016 · 4 comments
Assignees

Comments

@manucorporat
Copy link
Contributor

manucorporat commented Jun 27, 2016

There are several issues related with events listeners and collision of gestures in Ionic 2 that should be fixed in order to provide the best UX experience closest to a native app.

At first, I am going to enumerate them, and then propose several solutions to each one. I think we should always try to fix it using native JS/CSS apis whenever it's possible.

Preventing scrolling in ion-content

It is desired to block scrolling when the following gestures are recognised:

Gesture collision

Performance

We should try to avoid fullscreen touchmove/mousemove listeners that can prevent optimus scrolling performance.

  • Swipe from edges
  • Sliding items

#7049

Future

  • 300ms delay hacks are not longer needed (WKWebView)
  • Touch-Action (WKWebView)
  • Passive event listeners

Solutions

Scrolling

To prevent scrolling is required to call preventDefault() on touchstart, mousedown or first scroll event, this is not always possible since several touchmove/mousemove events are required before a panx can be recognised:

  • Newest CSS properties like touch-action can help in Range, blocking scrolling only when the user is in fact dragging the range.
  • Extend the approach used by ion-backdrop to block scrolling.

https://github.com/driftyco/ionic/blob/a1a582b7a10e641e6f2e1dd0f2937c85db82394d/src/components/backdrop/backdrop.ts#L21-L23

ScrollManager: #7066

Gesture collision

Same problem, swipe gestures need several events in order to be detected.
#6726

@manucorporat
Copy link
Contributor Author

#7120

@paulogr
Copy link

paulogr commented Jun 30, 2016

Following!

@manucorporat
Copy link
Contributor Author

manucorporat commented Jun 30, 2016

@danbucholtz #7066

@danbucholtz
Copy link
Contributor

I closed #7066. I am imagining an implementation like this:

As a developer, I would like to ability to freeze/prevent scrolling of a particular scroll view, or even the entire app. The use case would be something like drag and drop, or even when swiping open an ion-item.

The ideal implementation allows a "ScrollDelegate" or something similar instance to be injected into component that lets the user call operations on it.

class ScrollDelegate{
   constructor(){
   }

   freezeAllScrolls(){
   }

   freezeScrollView(scrollViewIdentifier:string){
   }
}

I am imagining an API that looks like this.

Thanks,
Dan

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants