Skip to content

fix(ios): forward statusTap from SystemBars - #8722

Open
Ajamuar wants to merge 1 commit into
ionic-team:mainfrom
Ajamuar:adityaj/fix-ios-systembars-statustap
Open

Ajamuar wants to merge 1 commit into
ionic-team:mainfrom
Ajamuar:adityaj/fix-ios-systembars-statustap

Conversation

@Ajamuar

@Ajamuar Ajamuar commented Nov 16, 2026 •

Copy link
Copy Markdown

Closes #8583

Description

The core SystemBars plugin never forwards the native status bar tap to the web view, so window never receives statusTap (used by Ionic for scroll-to-top) once an app migrates from @capacitor/status-bar to SystemBars. Capacitor iOS already detects the tap and posts Notification.Name.capacitorStatusBarTapped; nothing in core was listening.

SystemBars now observes that notification in load() and calls bridge.triggerJSEvent(eventName: "statusTap", target: "window"), the same call @capacitor/status-bar makes. If the StatusBar plugin is also registered, SystemBars skips the event so the page still gets exactly one statusTap per tap. The observer is removed in deinit.

Change Type

  • Fix
  • Feature
  • Refactor
  • Breaking Change
  • Documentation
  • Other (CI, chores, etc.)

Rationale / Problems Fixed

Restores the established statusTap behaviour for apps that only use the core SystemBars API, so they don't need to keep @capacitor/status-bar installed just for this event (#8583).

Tests or Reproductions

Stock app from npm init @capacitor/app with @capacitor/ios via CocoaPods (so the patched source is compiled), a window statusTap listener that logs each event on screen, and a tall scrollable page. Simulator: iPhone 17, iOS 26.5. 3 status bar taps per run:

  • @capacitor/ios 8.6.2 from npm, no @capacitor/status-bar: 0 statusTap events (the page does scroll to top, so the taps reach iOS)
  • This branch, no @capacitor/status-bar: 3 events, one per tap
  • This branch + @capacitor/status-bar 8: 3 events, one per tap (no duplicates)
  • npm run swiftlint -- lint: no findings in SystemBars.swift; npm run verify (in ios/) passes

Screenshots / Media

N/A

Platforms Affected

  • Android
  • iOS
  • Web

Notes / Comments

While testing on iOS 26.5 I noticed that status bar taps only reach Capacitor's handleTapAction: hook when the web content is scrollable; with a short, non-scrolling page neither this change nor @capacitor/status-bar receives the tap. That is existing iOS/Capacitor behaviour and not changed here, but worth knowing when reproducing.

The StatusBar check is done at tap time rather than in load(), so it doesn't depend on plugin load order.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: SystemBars omits the iOS statusTap bridge

1 participant