-
Notifications
You must be signed in to change notification settings - Fork 603
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
@capacitor/browser: window is not closing properly #2045
Comments
I traced down the issue to this reproducible snippet: await Browser.addListener(
'browserFinished',
(): void => void Browser.close())
);
await Browser.open({ url: 'http://capacitorjs.com/' }); The root cause is when you try to close the browser while it is already closed or being closed. |
This issue needs more information before it can be addressed. Please see the Contributing Guide for how to create a Sample App. Thanks! |
I'm running into the same problem where the Browser doesn't fully close and I'm left with the status bar and action bar still on the screen, just like in @Badisi's video. However, I don't have a const handle = await Browser.addListener("browserFinished", async () => {
this.doSomeCoolStuff();
await handle.remove();
});
await Browser.open({ url }); My app is running in landscape, and my test device is portrait rotation-locked, so when the Browser opens, it rotates back to portrait. And when I close the Browser, it switches back to landscape and then the bug occurs with the stuck status bar and action bar. HOWEVER, if I disable the device's portrait rotation-lock, the Browser will open in landscape to match the current orientation, and this time, when I close the Browser, everything works perfectly. Not sure why this happens. And I don't think there's currently a way to set the orientation of the Browser. Plugin(s)@capacitor/[email protected] Capacitor Version
Platform(s)Android My test devices are: |
I am having the same issue where the Browser doesn't close when pressing X, but leaves behind a black header and transparent body. I have to manually tap Back to close it and be able to interact with the app again. I am not doing any manual closing or anything. I have the app locked in Landscape mode. I don't know if that is relevant. |
I have exactly the same issue, but it is reproduced only on weaker android device. On fast phone it runs ok. |
@Ionitron Steps to reproduce: Please use the three-button navigation mode instead of gesture mode to reproduce this issue, as it allows for pressing the back button |
Same here ... |
Bug Report
Plugin(s)
@capacitor/[email protected]
Capacitor Version
Platform(s)
Android
Current Behavior
When opening and closing a browser on Android, the browser sometimes seems to get stuck.
As we can see in the video below, a browser is opened programmatically from the app then closed manually.
The issue is that the closing is failing randomly, leaving the app unresponsive.
We can see the first time the window is closed, that a black bar is sliding from the top of the app to the bottom.
And when the closing is failing (ie. the second time), the top bar suddenly changes to black and stays there.
Like if the window was still there, but transparent, on top of the app view, and thus not allowing to interact with it.
We can also see that once we move the app to the background then foreground, the black top bar disappears and the app is responsive again.
41.mov
Expected Behavior
Browser window should always close without issue.
The text was updated successfully, but these errors were encountered: