fix(ios): clear the List row fill so a declared list background shows - #76
Open
CodyPChristian wants to merge 1 commit into
Open
fix(ios): clear the List row fill so a declared list background shows#76CodyPChristian wants to merge 1 commit into
CodyPChristian wants to merge 1 commit into
Conversation
ListBackgroundModifier hides the grouped scroll background when a list node declares one, but SwiftUI also gives every row an opaque system fill. That row fill paints over the list's background, so `<list class="bg-...">` still rendered as a white sheet with the declared colour visible only at the very top and bottom edges. Clearing the row background lets the list's colour show while each row still paints whatever its own content declares. Android is unaffected: Compose has no implicit row fill.
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.
The bug
ListBackgroundModifierhides the grouped scroll background when a list node declares one:content .scrollContentBackground(.hidden) .background(Color(argb: argb))But SwiftUI also gives every row an opaque system fill, and that paints over the list's background. So
<list class="bg-theme-background">still renders as a white sheet, with the declared colour visible only in the thin strips above the first row and below the last.The effect is that a themed list-based screen looks broken next to an otherwise-identical scroll-view-based one.
The fix
One line in
rowView():The row becomes transparent, so the list's declared background shows through, and each row still paints whatever its own content declares (a card, a surface colour, nothing).
Scope
ListBackgroundModifieris already a no-op otherwise, so the stock grouped look is unchanged for everyone else.ListRenderer.ktalready drawsMaterialTheme.colorScheme.background.Verified
Built and run on an iOS 26 simulator against a themed app: a
<list>screen now matches its<scroll-view>equivalent, rows still render their own card backgrounds, and separators/swipe actions are unchanged.