fix(header): collapsible large title main header does not flicker on load #28277
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 #27060
What is the current behavior?
The main header is controlled by the header with
collapse="condense"
set:ionic-framework/core/src/components/header/header.tsx
Line 144 in a04a11b
The collapse header will hide the main header and then show it once the user has scrolled enough. However, if the main header is rendered before the collapse header is rendered, then the main header will be visible for a brief moment before being hidden by the collapse header. This gives the perception of flicker that is reported on the linked issue.
What is the new behavior?
The selector was written in a way such that once the collapse header loads, this CSS no longer applies (since the collapse header will add
.header-collapse-main
to the main header)main
RPReplay_Final1696366309.MP4
RPReplay_Final1696366283.MP4
Does this introduce a breaking change?
Other information
Note:
:has
browser compat is still fairly new. However, it is available on both Chromium and WebKit browsers (and has been for at least a year): https://caniuse.com/?search=%3AhasGiven that this bug is a fairly minor UI glitch (as opposed to something that would cause an app to crash or otherwise malfunction), I think this is an acceptable tradeoff. As time goes on this will become less of a concern as more users update their devices.
Dev build:
7.4.3-dev.11696365694.156f41d3