Repository navigation
Conversation
Add `scrollEffect="fade"` to ion-tab-bar. The tab bar background fades out when the content is scrolled to the end, like the footer. A tab bar inside ion-tabs now follows the content of the page that is visible, instead of the first content in the app. Previously, `scrollEffect="hide"` only worked for the first tab and did not work on pages pushed inside of a tab, or on the first page when it was loaded directly in Vue. The scroll effect of a tab bar in ion-tabs only applies to pages that cannot go back by default, so that the tab bar stays in place on pages that were navigated to. Add `tabBarScrollEffect` to ion-content to turn it on or off for a page. Change how `scrollEffect="hide"` moves the header, footer, and tab bar. They follow the scroll pixel by pixel instead of animating after a threshold. A bar that is fully out of view only returns when the user scrolls back quickly, so that slow scrolling and small movements do not bring it back. A bar that is partly out of view follows the scroll back at any speed, and settles to the closest edge when the scrolling stops. The header and footer fade out as they move out of view, so they do not stay visible in front of a tab bar that is out of view. The content extends under the bars, so hiding a bar no longer leaves a gap, including when a header and a tab bar hide together. A header, footer, or tab bar that is out of view is no longer inert or hidden from assistive technology. It moves back into view when an element in it receives focus, so keyboard and screen reader users can reach it without scrolling back quickly. A header that hides on scroll no longer takes part in the large title collapse. The large title scrolls away with the content instead of disappearing when the header is already out of view. References ionic-team#26510
|
@DwieDima is attempting to deploy a commit to the Ionic Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue number: resolves #26510
What is the current behavior?
ion-tab-barhas nofadescroll effect, unlikeion-headerandion-footer(feat: tab-bar fades in on scroll on iOS #26510).scrollEffect="hide"on anion-tab-barinsideion-tabsonly follows the firstion-contentin the app. It works on the first tab, but not on other tabs or on pages that are pushed inside of a tab.scrollEffect="hide"animates out after a scroll threshold and returns on the first pixel scrolled back. A header and a tab bar that hide together leave a gap behind.What is the new behavior?
ion-tab-barsupportsscrollEffect="fade". The background and border fade out when the content is scrolled to the end and fade back in when scrolling away from it. The tab buttons are not affected.scrollEffect="hide"follows the scroll pixel by pixel forion-header,ion-footer, andion-tab-bar. A bar that is fully out of view only returns when the content is scrolled back quickly, so slow scrolling and small movements do not bring it back. A bar that is partly out of view follows the scroll back at any speed, and settles to the closest edge when the scrolling stops. The content extends under the bars, so no gap is left behind. The header and footer also fade out as they move, so they cannot stay visible in front of a tab bar that is out of view.inertor hidden from assistive technology, and moves back into view when an element in it receives focus, so keyboard and screen reader users can reach it without scrolling back quickly.ion-tabsfollows the page that is visible, and by default only applies its scroll effect to pages that cannot go back, such as the root page of a tab. The tab bar stays in place on pages that were navigated to. A page can change this with the newtabBarScrollEffectproperty onion-content.scrollEffect="fade"on a translucent tab bar.Usage
Set
scroll-effecton the tab bar. It works the same in Angular, React, and Vue.The header and the footer take the same property, and apply to the page they are in:
Use
tabBarScrollEffecton the content of a page to decide whether the tab bar applies its scroll effect there:When it is not set, the scroll effect applies to pages that cannot go back, and not to pages that can.
Try it
The scenarios above are in a sample app: ionic-tab-bar-scroll-effect-sample.
Does this introduce a breaking change?