question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: canceling swipe back animation causes white screen on android devices

See original GitHub issue

Bug Report

Ionic version:

[x] 5.x

Current behavior:

Using swipe gestures to navigate back on Android devices leaves the screen completly white if the gesture is canceled mid-way.

DevTools-0 0 0 0_8100_tabs_tab1-2020-04-16-17-36-09

Expected behavior:

Swipte back gesture should show the previous screen.

Steps to reproduce:

  1. Push a new page in the view stack with navigateForward
  2. Start the swipe back gesture (finger on left device side and move to the right)
  3. … while holding the finger down, move back to the left side (to cancel the swipe animation) ==> Screen stays white

You can perform the gesture in a few milliseconds or take your time and do it very slowly. It is 100% reproducible.

Related code:

Enable the following in the app.module.ts

IonicModule.forRoot({
     swipeBackEnabled: true 
}),

https://github.com/capc0/ion-android-swipe-gesture-white-screen

Other information:

Ionic info:

Ionic:

   Ionic CLI                     : 5.4.9 (C:\Users\Simon\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 5.0.7
   @angular-devkit/build-angular : 0.803.26
   @angular-devkit/schematics    : 8.3.26
   @angular/cli                  : 8.3.26
   @ionic/angular-toolkit        : 2.2.0

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.1.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.0, (and 4 other plugins)

Utility:

   cordova-res : 0.6.0 (update available: 0.12.0)
   native-run  : 0.2.8 (update available: 1.0.0)

System:

   NodeJS : v10.16.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.13.7
   OS     : Windows 10

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
capc0commented, May 8, 2020

LGTM. thanks for the quick response.

1reaction
capc0commented, May 8, 2020

The problem seems to be that the ``display: none``` style does not get removed when canceling the animation

image

edit: I just checked your commit (https://github.com/ionic-team/ionic/pull/21058/files), seems to me like leavingPage.elements[0] focuses the wrong HTML element.

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug: canceling swipe back animation causes white screen on ...
Bug Report · Push a new page in the view stack with navigateForward · Start the swipe back gesture (finger on left device...
Read more >
Gestures still broken. Leads to "touch problem" or "animation ...
When you swipe very very fast and swiftly from the edge of the screen towards the middle, user can notice that system is...
Read more >
Why Android's gesture navigation fails (and how to fix it)
On Android, a swipe up will bring the user to the recents menu, which is fine, that's not the problem. The problem is...
Read more >
Flutter: Disable Swipe to Navigate Back in iOS and Android
I simply changed "return false" to "return true", so that the hardware and appbar back buttons work while the swipe back is still...
Read more >
Animation | Jetpack Compose - Android Developers
Overview. Animations are essential in a modern mobile app in order to realize a smooth and understandable user experience. Many Jetpack Compose Animation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found