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

statusTap event not working on iOS 13 #2109

Closed
1 of 4 tasks
biesbjerg opened this issue Oct 29, 2019 · 9 comments · Fixed by #2376
Closed
1 of 4 tasks

statusTap event not working on iOS 13 #2109

biesbjerg opened this issue Oct 29, 2019 · 9 comments · Fixed by #2376

Comments

@biesbjerg
Copy link

Bug Report

Capacitor Version

npx cap doctor output:

💊   Capacitor Doctor  💊

Latest Dependencies:

  @capacitor/cli: 1.3.0

  @capacitor/core: 1.3.0

  @capacitor/android: 1.3.0

  @capacitor/ios: 1.3.0

Installed Dependencies:

  @capacitor/cli 1.3.0

  @capacitor/core 1.3.0

  @capacitor/android 1.3.0

  @capacitor/ios 1.3.0


[success] Android looking great! 👌
  Found 4 Capacitor plugins for ios:
    @biesbjerg/capacitor-music-player (0.0.1)
    @teamhive/capacitor-email (2.1.2)
    capacitor-analytics (0.0.4)
    cordova-plugin-inapppurchase (1.2.0)
[success] iOS looking great! 👌

Affected Platform(s)

  • Android
  • iOS
  • Electron
  • Web

Current Behavior

When tapping on status bar ion-content does not scroll to top

Expected Behavior

Scroll to top on tap

@jcesarmobile
Copy link
Member

This is only on iOS 13, right?

@andreas-aeschlimann
Copy link

I have seen this issue on iOS 13.0 and 13.1 (iPhone XS Max, iPhone 11 Pro Max) so far.

On Android and iOS 12.x (iPhone X) it worked as expected.

@jcesarmobile
Copy link
Member

The problem is statusTap event not working on iOS 13. Ionic uses that event to scroll the internal content.

On a non Ionic app with content bigger than the screen, if you tap the status bar it will still scroll to top as expected.

@jcesarmobile jcesarmobile changed the title Tapping on status bar does not scroll to top statusTap event not working on iOS 13 Oct 29, 2019
@andreas-aeschlimann
Copy link

What do you suggest as workaround until it is fixed?

Does the Cordova plugin have the same issue in iOS 13?

@bryplano
Copy link
Contributor

The Cordova approach adds a scrollview off screen that forwards in the touch/tap event. It's a hacky solution that causes other problems.

There isn't a great workaround until Apple makes changes to better support or fix statusTap in iOS.

@jcesarmobile jcesarmobile added bug platform: ios needs discussion decisions must be made before working on it labels Jan 16, 2020
@jcesarmobile
Copy link
Member

I've found another possible solution, but it's also hacky.

We can swizzle handleTapAction on UIStatusBarManager class. (meaning, it removes the handleTapAction method and add a custom one that can send the event to javascript).

So either way, the two possible options are hacky, not sure which one is better.

@Proper-Job
Copy link

The reason the statusTap event isn't called is because touchesBegan is no longer called on the AppDelegate on iOS 13.
iOS 13 introduced a new way to manage the App's Life Cycle with UISceneDelegate.

@andreas-aeschlimann
Copy link

This works for me now, thanks a lot for fixing it!

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 11, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants