-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Capacitor Version
Capacitor Doctor
Latest Dependencies:
@capacitor/cli: 7.1.0
@capacitor/core: 7.1.0
@capacitor/android: 7.1.0
@capacitor/ios: 7.1.0
Installed Dependencies:
@capacitor/cli: 7.1.0
@capacitor/core: 7.1.0
@capacitor/android: 7.1.0
@capacitor/ios: 7.1.0
[success] Android looking great! 👌
[error] Xcode is not installed
Other API Details
Platforms Affected
- iOS
- Android
- Web
Current Behavior
The new adjustMarginsForEdgeToEdge feature introduced in Capacitor 7.1.0 does not appear to be working as expected. I have installed Capacitor 7.1.0, set this option to 'auto' and 'force' in my configuration, but margins are not being adjusted accordingly.
Expected Behavior
When set to "force", margins should always be adjusted for edge-to-edge display.
When set to "auto", margins should be adjusted if running on Android 15 and windowOptOutEdgeToEdgeEnforcement is false or missing.
Project Reproduction
Any Android project with Capacitor 7.1.0 installed.
Additional Information
After some troubleshooting, I found that the following check fails:
if (webView instanceof CapacitorWebView capacitorWebView) {
capacitorWebView.setBridge(bridge);
capacitorWebView.edgeToEdgeHandler(bridge);
}
The edgeToEdgeHandler method does not get called because webView is not an instance of CapacitorWebView. This seems to be preventing the margins from being adjusted as expected.
Could this be a bug, or is there an additional setup required to ensure webView is correctly recognized as a CapacitorWebView?