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

bug: footer/tab-bar hides when webview resizing is disabled and keyboard opens which causes layout shift #28226

Open
3 of 8 tasks
AmitMY opened this issue Sep 24, 2023 · 7 comments
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@AmitMY
Copy link
Contributor

AmitMY commented Sep 24, 2023

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

  • Back button does not overlap page title (pretty sure this is an iOS 16 regression)
RPReplay_Final1695561736.2.MOV
  • Keyboard resizes the layout with a significant delay instead of animating the layout size like on chat apps
RPReplay_Final1695561736.MOV

Quick demo video:

Expected Behavior

The user should not feel like they are using a non-native inferior application. Despite building with web technologies, there should be a near-native experience.

Steps to Reproduce

Open various ionic templates on the device (ideally known apps, like whatsapp or tinder etc) and compare the ionic experience to the native one.

Code Reproduction URL

No response

Ionic Info

Ionic:

   Ionic CLI : 7.1.1

Utility:

   cordova-res : 0.15.4
   native-run  : 1.7.3

System:

   NodeJS : v18.15.0
   npm    : 9.6.7
   OS     : macOS Unknown

Additional Information

I would like to release my app soon, and before I do that, I am doing some usability testing.
but the app does not feel like a native iOS 17 application.

@ionitron-bot ionitron-bot bot added the triage label Sep 24, 2023
@liamdebeasi liamdebeasi self-assigned this Sep 25, 2023
@liamdebeasi
Copy link
Contributor

Thanks for the report. There are several requests here, so I'll address each one individually:

  1. Back button does not align with the title
    I can confirm this is an Ionic bug.

  2. Input does not adjust with the keyboard
    Ionic does not handle this for you. We handle ensuring inputs in the scrollable area are not hidden by the keyboard, but developers are responsible for ensuring things like floating inputs respond to the keyboard. I show how to accomplish this in https://ionic.io/blog/keyboard-improvements-for-ionic-apps. Note you may want to disable webview resizing for this.

  3. Performance issues with swipe to go back
    I need a reproduction case for this, otherwise there's not much we can do.

  4. Main tab is not highlighted in the root path
    As noted, this is already being tracked in bug: angular, tabs does not support root path (without /tabs) #16949.

  5. Tab text does not go horizontal in landscape mode
    As noted, this is already being tracked in feat: support dynamic tab button layout based on orientation #27429.

@liamdebeasi liamdebeasi added the needs: reply the issue needs a response from the user label Sep 25, 2023
@liamdebeasi liamdebeasi removed their assignment Sep 25, 2023
@ionitron-bot ionitron-bot bot removed the triage label Sep 25, 2023
@AmitMY
Copy link
Contributor Author

AmitMY commented Sep 30, 2023

Thank you for pointing out the keyboard fix -

To be complete though, can you confirm that it is a bug that the ion-tab-bar hides when the keyboard is visible AND the Keyboard.resizeMode is KeyboardResize.None?

this.keyboardVisible = keyboardOpen; // trigger re-render by updating state

I think that in that case (when the keyboard is showing but there is no page resize, the tab bar should not hide, since by hiding it changes the inner page height)

@ionitron-bot ionitron-bot bot added triage and removed needs: reply the issue needs a response from the user labels Sep 30, 2023
@liamdebeasi
Copy link
Contributor

To be complete though, can you confirm that it is a bug that the ion-tab-bar hides when the keyboard is visible AND the Keyboard.resizeMode is KeyboardResize.None?

I think that in that case (when the keyboard is showing but there is no page resize, the tab bar should not hide, since by hiding it changes the inner page height)

Do you have a sample I can try that shows the issue?

@liamdebeasi liamdebeasi added the needs: reply the issue needs a response from the user label Oct 4, 2023
@ionitron-bot ionitron-bot bot removed the triage label Oct 4, 2023
@AmitMY
Copy link
Contributor Author

AmitMY commented Oct 9, 2023

Here's an example of an app:

git clone https://github.com/sign/translate
cd translate
bun install
bun run build && \
bun x cap sync && \
bun x cap run ios

It includes the keyboard animation code: https://github.com/sign/translate/blob/master/src/app/directives/keyboard-flying.directive.ts
but because it has "tabs", the tabs disappear, and then there is some small discrepancy in the viewport when the keyboard is hidden (note the small skeleton shifting a bit)

RPReplay_Final1696842108.mov

@ionitron-bot ionitron-bot bot added triage and removed needs: reply the issue needs a response from the user labels Oct 9, 2023
@liamdebeasi liamdebeasi self-assigned this Oct 9, 2023
@liamdebeasi
Copy link
Contributor

Thanks! So it sounds like there are two bugs here:

  1. The large title does not align with the back button during the transition

This is being addressed in #28290.

  1. The tab bar/footer hides when webview resizing is disabled which causes undesired layout shifts

I'll open a PR to address this shortly.

@liamdebeasi liamdebeasi changed the title bug: Inconsistencies between Ionic and Native iOS 17 bug: footer/tab-bar hides when webview resizing is disabled which causes layout shift Oct 9, 2023
@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report labels Oct 9, 2023
@liamdebeasi liamdebeasi removed their assignment Oct 9, 2023
@ionitron-bot ionitron-bot bot removed the triage label Oct 9, 2023
@liamdebeasi liamdebeasi changed the title bug: footer/tab-bar hides when webview resizing is disabled which causes layout shift bug: footer/tab-bar hides when webview resizing is disabled and keyboard opens which causes layout shift Feb 1, 2024
@hedinasr
Copy link

hedinasr commented Mar 9, 2024

any news on this please ?

@hedinasr
Copy link

A workaround for the tab bar/footer that hides when webview resizing is disabled which causes undesired layout shifts:

  const observer = new MutationObserver((mutations) => {
    mutations.forEach((mutation: MutationRecord) => {
      const target = mutation.target as HTMLElement;
      if (target.classList.contains('tab-bar-hidden')) {
        target.classList.remove('tab-bar-hidden');
      }
    })
  })

  useEffect(() => {
    const tabBar = document.querySelector('ion-tab-bar');
    observer.observe(tabBar as Node, {
        attributes: true,
        attributeFilter: ['class'],
      });

      return () => {
        observer.disconnect()
      }
  }, [])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants