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 with collapse property set to fade does not render properly on dynamic content #29451

Open
3 tasks done
ijsje71 opened this issue May 3, 2024 · 0 comments
Open
3 tasks done
Labels

Comments

@ijsje71
Copy link

ijsje71 commented May 3, 2024

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

When dynamically loading in content, a footer that has the collapse property set to fade is not properly refreshed. Instead of having a full footer, the --opacity-scale property is set to a very small number (since it did not have any content when it was rendered in), but is not updated when the content is loaded. Only when the user then scrolls, the footer realises that there's scrollable content and then the footer updates accordingly.

In my code example I have 2 pages, one with plain text that makes the content scrollable. This is picked up by the footer and is rendered in correctly.
Simulator Screenshot - iPhone 15 Pro Max - 2024-05-03 at 14 30 25

When you click the next button, you'll see the bug.
Simulator Screenshot - iPhone 15 Pro Max - 2024-05-03 at 14 30 34

Expected Behavior

I expect the footer to update once the content is loaded into the page, instead of when the user first scrolls after the content is loaded. Since the content is loaded using state variables, I would expect the pages to handle the changes accordingly.

Steps to Reproduce

  1. Run the test project in the iOS simulator
  2. Click the "Open" button
  3. See the Plain Text page. This shows that when the content is loaded as plain text, the footer is correctly rendered
  4. Click the Next button.
  5. Observe the bug occurring

First the page loads without any content (it's fetching it from a free API)
Then the content is loaded
Notice how the buttons now float onto that content, instead of being rendered inside the footer
Scroll the page
Notice the footer reappears

Since I'm using a free API that returns random data for this, you may have to go back & forth between the Plain Text and Dynamic Text pages a few times before it provides enough content for the bug to happen.

Code Reproduction URL

https://github.com/ijsje71/footer-not-rendering-correctly-example

Ionic Info

Ionic:

Ionic CLI : 7.1.5 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/react 7.7.3

Capacitor:

Capacitor CLI : 5.7.0
@capacitor/android : not installed
@capacitor/core : 5.7.0
@capacitor/ios : 5.7.0

Utility:

cordova-res : not installed globally
native-run : 2.0.1

System:

NodeJS : v20.10.0 (/usr/local/Cellar/node@20/20.10.0/bin/node)
npm : 10.2.3
OS : macOS Unknown

Additional Information

One of the workarounds that I have tried is loading in the footer once the content is loaded using inline JSX expressions, similar to this:
{content && ( <IonFooter>(...)</IonFooter> )}

I have since removed this workaround, however, since it interferes with the page transitions. Since the footer is loaded after initial rendering, the footer is excluded from the page transition animations. I need a fix so that the page transitions remain intact, and the footer is also rendered in correctly.

@ionitron-bot ionitron-bot bot added the triage label May 3, 2024
@sean-perkins sean-perkins removed their assignment May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants