Add option to render compound field without the chrome#5137
Open
burieberry wants to merge 5 commits into
Open
Conversation
Contributor
Preview deploymentsHost Test Results 1 files 1 suites 3m 34s ⏱️ Results for commit 7ad0fa7. For more details on these errors, see this check. Realm Server Test Results 1 files 1 suites 8m 11s ⏱️ Results for commit 7ad0fa7. |
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.
@displayContainerargument is currently only used for CardDefs. I propose providing this option to compound fields as well (including containsMany field), to be able to render the field without the chrome around it. This makes it easier to style the component and items.Summary
@displayContainerargument tocontainsManyfield components, allowing callers torender list items directly without the wrapping
plural-fielddiv and its associated chrome(borders, spacing, scaffold).
@displayContainer={{false}},containsMany-componentrenders each child item bare;the argument is forwarded to child field components so compound fields also skip their
container wrapper.
Why
Card authors composing custom layouts need to embed a
containsManyfield inside their ownmarkup — a
<ul>, a CSS grid, aBoxelContainer— without fighting the default container'sstyles and structure. The new argument opts out of that chrome while keeping the field's
rendering and format logic intact.
Test plan
card-basics-test.gts— new integration tests cover@displayContainer={{false}}on acontainsManyfield: items render without the wrapper div, and the default(
@displayContaineromitted /true) continues to render the chrome as before.