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
bug: Tab bar is unhidden too quickly after keyboard dismiss #25990
Comments
We just ran into this too (cc @mlynch ) |
Looks like this started in 6.2.3. Works well in 6.2.2. Could be related to #25746 |
@liamdebeasi Any info on when this fix will be merged into production? Thanks! |
Still breaking in 6.3.8. |
Same for me in 6.3.9
And then provided |
@aginvlad thanks for sharing. I seem to see the tab bar flash still because the tab bar is being unhidden a little too soon so I have changed the timeout delay to 100ms and seems to work consistently. The full code for anybody interested:
@liamdebeasi can you give any insight into when this issue will be resolved in production? |
No improvement in 6.4.2. |
Just upgraded to Ionic 7.0.0, and not seeing any improvement. Can we get some feedback on this please? I guess we'll have to use some hack, we're currently stuck on Ionic 6.2.2. |
@mlynch this one seems worth looking at :) |
@maccman talked to the team and it's currently being looked at. Hope to have an update soon |
I have the same issue with Ionic 7, see #27386 |
Can everyone try the following dev build and let me know if it resolves the issue?
Install Example:
|
HI @liamdebeasi, the problem still exists for me after installing "7.0.6-dev.11683572927.1bfe3920". |
Can you run |
Here you go
RPReplay_Final1683637381.MP4 |
Thanks! Can you send over a sample app that reproduces the issue? The sample app I have no longer reproduces the issue with the dev build installed. |
Here the adapted code (login removed, at start directly the test page) https://www.dropbox.com/s/uaguy8k1feylaag/APP_RL_GITHUB_ISSUE_25990.zip?dl=0 Please a short response, then I will delete the File, thanks! |
I'm not able to install the dependencies in your project:
Do you have a minimal reproduction of the issue? |
Here a minimal reproduction: |
The issue appears resolved when using the dev build and your sample reproduction: RPReplay_Final1683640311.MP4Can you make sure you do a clean build/sync when testing in your application?
|
Can you give this new dev build a try?
|
It is better, but not completely gone. |
Do you have an example of this issue happening when using split pane? |
Here is the App with the split pane. I removed a few packages, so https://www.dropbox.com/s/qbr278uqe8x9p5r/APP_RL_GITHUB_ISSUE_25990_2.zip?dl=0 Please a short response, then I will delete the File, thanks! Most likely the error occurs when going from tab 1 to tab 2, then directly activating the input. |
Thanks for testing. I think I have resolved the lingering issues if you are interested in giving this another test:
|
Works, thank you! |
Issue number: resolves #25990 --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> The tab bar and footer are being shown too soon after the keyboard begins to hide. This is happening because the webview resizes _after_ the keyboard begins to dismiss. As a result, it is possible for the tab bar and footer to briefly appear on the top of the keyboard in environments where the webview resizes. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - The tab bar and footer wait until after the webview has resized before showing again | before | after | | - | - | | <video src="https://user-images.githubusercontent.com/2721089/236905066-42ac17a5-a5bf-458b-9c62-005fcce05e20.MP4"></video> | <video src="https://user-images.githubusercontent.com/2721089/236905185-d2f539d1-6d93-4385-b1cb-24dd7aa06393.MP4"></video> | This code works by adding an optional parameter to the keyboard controller callback called `waitForResize`. When defined, code within Ionic can wait for the webview to resize as a result of the keyboard opening or closing. Tab bar and footer wait for this `waitForResize` promise to resolve before re-showing the relevant elements. This `waitForResize` parameter is only only defined when all of the following are two: **1. The webview resize mode is known and is _not_ "None".** If the webview resize mode is unknown then either the Keyboard plugin is not installed (in which case the tab bar/footer are never hidden in the first place) or the app is being deployed in a browser/PWA environment (in which case the web content typically does not resize). If the webview resize mode is "None" then that means the keyboard plugin is installed, but the webview is configured to never resize when the keyboard opens/closes. As a result, there is no need to wait for the webview to resize. **2. The webview has previously resized.** If the keyboard is closed _before_ the opening keyboard animation completes then it is possible for the webview to never resize. In this case, the webview is at full height and the tab bar/footer can immediately be re-shown. ------ Under the hood, we use a [ResizeObserver](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) to listen for when the web content resizes. Which element we listen on depends on the resize mode set in the developer's Capacitor app. We determine this in the `getResizeContainer` function. From there, we wait for the ResizeObserver callback, then wait 1 more frame so the promise resolves _after_ the resize has finished. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> Dev build: `7.0.6-dev.11683905366.13943af0`
Issue number: resolves #25990 --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> <!-- Please describe the current behavior that you are modifying. --> The tab bar and footer are being shown too soon after the keyboard begins to hide. This is happening because the webview resizes _after_ the keyboard begins to dismiss. As a result, it is possible for the tab bar and footer to briefly appear on the top of the keyboard in environments where the webview resizes. <!-- Please describe the behavior or changes that are being added by this PR. --> - The tab bar and footer wait until after the webview has resized before showing again | before | after | | - | - | | <video src="https://user-images.githubusercontent.com/2721089/236905066-42ac17a5-a5bf-458b-9c62-005fcce05e20.MP4"></video> | <video src="https://user-images.githubusercontent.com/2721089/236905185-d2f539d1-6d93-4385-b1cb-24dd7aa06393.MP4"></video> | This code works by adding an optional parameter to the keyboard controller callback called `waitForResize`. When defined, code within Ionic can wait for the webview to resize as a result of the keyboard opening or closing. Tab bar and footer wait for this `waitForResize` promise to resolve before re-showing the relevant elements. This `waitForResize` parameter is only only defined when all of the following are two: **1. The webview resize mode is known and is _not_ "None".** If the webview resize mode is unknown then either the Keyboard plugin is not installed (in which case the tab bar/footer are never hidden in the first place) or the app is being deployed in a browser/PWA environment (in which case the web content typically does not resize). If the webview resize mode is "None" then that means the keyboard plugin is installed, but the webview is configured to never resize when the keyboard opens/closes. As a result, there is no need to wait for the webview to resize. **2. The webview has previously resized.** If the keyboard is closed _before_ the opening keyboard animation completes then it is possible for the webview to never resize. In this case, the webview is at full height and the tab bar/footer can immediately be re-shown. ------ Under the hood, we use a [ResizeObserver](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) to listen for when the web content resizes. Which element we listen on depends on the resize mode set in the developer's Capacitor app. We determine this in the `getResizeContainer` function. From there, we wait for the ResizeObserver callback, then wait 1 more frame so the promise resolves _after_ the resize has finished. - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> Dev build: `7.0.6-dev.11683905366.13943af0`
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 Ionic, please create a new issue and ensure the template is fully filled out. |
Prerequisites
Ionic Framework Version
Current Behavior
When the keyboard is dismissed the tab bar temporarily flashes on the screen as it is unhidden before the webview has expanded back to the full size of the viewport.
Simulator.Screen.Recording.-.iPhone.14.-.2022-09-22.at.13.55.17.mp4
Expected Behavior
The tab bar should not be unhidden until the web view has expanded back to its full size so that the tab bar does not flash in the center of the screen.
Steps to Reproduce
Use the default capacitor keyboard config:
This happens on any page with an
IonTabBar
.Code Reproduction URL
No response
Ionic Info
Ionic:
Ionic CLI : 6.20.1 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/react 6.2.8
Capacitor:
Capacitor CLI : 4.3.0
@capacitor/android : not installed
@capacitor/core : 4.3.0
@capacitor/ios : 4.3.0
Utility:
cordova-res : not installed globally
native-run : 1.7.0
System:
NodeJS : v16.14.2 (/usr/local/bin/node)
npm : 8.7.0
OS : macOS Monterey
Additional Information
No response
The text was updated successfully, but these errors were encountered: