Check if tab bar hidden value actually changed for Shell#31149
Merged
Check if tab bar hidden value actually changed for Shell#31149
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an infinite loop issue in iOS 26 where setting the TabBarHidden property triggers ViewWillLayoutSubviews, which in turn calls UpdateTabBarHidden() again. The fix adds a simple value comparison check to prevent unnecessary property updates when the value hasn't actually changed.
- Adds early return when
TabBarHiddenalready matches the desired state - Prevents infinite loop by avoiding redundant property assignments
- Applied broadly rather than iOS 26-specific for general defensive programming
Comments suppressed due to low confidence (1)
dalexsoto
approved these changes
Aug 13, 2025
mattleibow
approved these changes
Aug 13, 2025
Member
|
/backport main |
Member
Author
|
/backport to main |
Contributor
|
Started backporting to main: https://github.com/dotnet/maui/actions/runs/16966624735 |
Member
Author
|
/backport to release/9.0.1xx-sr8 |
Contributor
|
Started backporting to release/9.0.1xx-sr8: https://github.com/dotnet/maui/actions/runs/17976094094 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description of Change
Adds a check to see if the value is actually different and only apply the change when it is different. It seems that for iOS 26 a change has been made that setting the
TabBarHiddenproperty now causesViewWillLayoutSubviewsto be triggered, which in turns updates theTabBarHiddencausing an infinite loop. This change prevents that.Since its a good thing to check anyway, not making this specific to iOS 26, although we could to be on the safe side