A few bugs with native scrolling

@ghaiat and I caught and made issues/PRs for a couple of bugs with native (overflow) scrolling, one of which was just released in v1.0.1. I’m posting here in the hopes that we can get these fixes implemented as quickly as possible (since the issues always seemed swamped and not to garner much attention).

The issues:

4008 completely breaks native scrolling on ios when the view doesn’t use the listView. We traced the bug to the drag gesture and an overzealous call to event.preventDefault()

4016 causes native scrolling views to not maintain their scroll position when moving away and back to the same view. Here the bug is occurring because of the $location decorator, where a test for for a hash value is also returning true even when the hash value is an empty string.

Thanks for checking these out, Ionic Team!

Yup, few bugs.

See https://github.com/driftyco/ionic/issues/4022 too.

Yep, i confirm the issues listed by @jskrzypek

@Jiyuu, can you try this fix out and let me know if it does anything for you?

It’s possible some of the weird behavior you’re seeing is because you don’t have an ion-list in your ion-content, and thus preventDefault() is called on your drag events as I documented on iOS in https://github.com/driftyco/ionic/issues/4008.

1 Like

Seems to work well @jskrzypek!
ion-list isn’t a mandatory in ion-content, is it?

@Jiyuu it’s possible another part of the 1.0.1 release fixed the bug for ioni-contents but the code issue #4008 points to does mean that evt.preventDefault will get called on drag events from parts of the app that don’t populate the ionic.Gestrures.gestures.Drag.prevent_default_directions array… which seems like it will either require significant effort to maintain or else will cause other errors down the line. I will try to reproduce and push a repo that can be built & tested on both platforms today.