Fix dead list-item taps and unthemed List background on iOS - #35
Merged
Conversation
Two independent iOS renderer gaps: 1. List-item rows attached onTapGesture via applyClickHandlers but never set a content shape, so taps only registered on opaque pixels — the padding and the Spacer gap between the text block and trailing content (most of the row) were tap-dead. @tap on a list-item effectively required hitting the text exactly. Add .contentShape(Rectangle()) before the click handlers so the whole row bounds is hittable. (Compose already covers full bounds via .clickable — Android was unaffected.) 2. SwiftUI's List paints the system (grouped) background and ignored the node's own background style, so a themed screen (bg-theme-background) rendered on stock systemGroupedBackground instead of the app palette. When the node declares a background, hide the system scroll background and paint the node's resolved color (light or dark variant) — matching how every other container element behaves. Lists without a declared background are unaffected. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Two independent iOS renderer gaps, both found by dogfooding a settings screen built on
native:list:1. List-item rows are mostly tap-dead
applyClickHandlersattachesonTapGesture, but without a content shape SwiftUI only registers taps on opaque pixels — the padding and theSpacergap between the text block and trailing content (i.e. most of the row) do nothing.@tapon a<native:list-item>effectively required hitting the text exactly; sparse rows felt completely dead. Verified by dumping the wire tree (on_presscorrectly registered) and then reading the renderer.Fix:
.contentShape(Rectangle())before the click handlers — the whole row bounds becomes hittable. Android is unaffected (Compose.clickablecovers full bounds).Note: the mail demo's
@tap="open(...)"rows have the same latent issue — dense rows just make lucky hits more common.2.
Listignores the app theme backgroundSwiftUI's
ListpaintssystemGroupedBackgroundand ignores the node's own background style, so<native:list class="bg-theme-background">rendered on the stock iOS gray — visibly off-palette in dark mode. Fix: when the node declares a background,.scrollContentBackground(.hidden)+ paint the node's resolved color (light/dark variant, same resolution asNodeStyleModifier). Lists without a declared background keep the stock appearance.Verified in a themed app in both modes (background pixel-checked against the theme token).
🤖 Generated with Claude Code