fix(sheet): preserve responsive breakpoints when Resizable()#4605
Merged
Conversation
Sheet.Resizable() read only Width?.Default when injecting resize min/max constraints, collapsing any multi-breakpoint Responsive<Size> down to the fallback default width. A responsive width that sets only Mobile/Tablet/Desktop/Wide (Default == null) therefore resolved to Sheet.DefaultWidth (Rem 24 ≈ 384px) and was re-wrapped as a flat, non-responsive width — pinning the sheet to ~384px and overflowing content on larger screens. Apply the min/max to every populated breakpoint via ApplyConstraints so the per-breakpoint ramp survives. Falls back to a single constrained default only when no breakpoint is set, and never overrides explicit per-breakpoint min/max. Same handling for the height axis (top/bottom sheets). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 16, 2026
rorychatt
reviewed
Jun 16, 2026
| { | ||
| height = height.Max(Size.Px(900)); | ||
| } | ||
| var height = ApplyConstraints(sheet.Height, Sheet.DefaultHeight, Size.Px(100), Size.Px(900)); |
Collaborator
There was a problem hiding this comment.
maybe this could and should have been hard-coded as a default value in the frontend (like some other default values in frontend for other widgets)
rorychatt
reviewed
Jun 16, 2026
rorychatt
left a comment
Collaborator
There was a problem hiding this comment.
Left minor feedback
-> I see that some other edge cases might brake, but time will tell.
The comment is about an already existing bad pattern, so IMO this is merge-able, but maybe we should fix/open issue about the default value coded in BE, not in FE
Collaborator
Staging removedStaging environment has been deleted for this PR. |
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.
Why is the fix specific to the Sheet widget?
Responsive width resolution is centralized and works correctly for every widget:
widgetRenderer.tsxresolvesprops.widthto the active breakpoint before the widget renders. Sheet is the only widget that rewrites its ownWidthin C# inside an extension method (Resizable()), upstream of that resolver — so it's the only place aResponsive<Size>can be silently flattened before it ever reaches the frontend.(The narrower limitation in the
Responsive<T>.At/.AndAPI that makes this easy to hit is tracked as a follow-up.)Problem
Resizable sheets with a multi-breakpoint responsive width collapse to a single fixed width (~384px) and overflow on larger screens.
Resizable()injects the resize min/max by reading onlyWidth?.Default:A
Responsive<Size>that sets onlyMobile/Tablet/Desktop/Wide(withDefault == null) resolves toSheet.DefaultWidth(Size.Rem(24)≈ 384px), re-wrapped as a flat, non-responsive width — discarding every breakpoint rule. (Resizable()rewrites the width because the resizable frontend reads its initial/min/max from the serialized"value,min,max"string.)Fix
Apply the default min/max to every populated breakpoint (
ApplyConstraints), preserving the responsive ramp. Keeps each breakpoint's explicitMin/Maxwhen set, falls back to a single constrained default only when no breakpoint is set, and applies the same handling to the height axis for top/bottom sheets.Tests
New
SheetResizableTests(4 cases) — the first reproduces the failing ramp; all would fail under the old.Default-only behavior. Build clean, 47/47 Sheet+Responsive tests pass,dotnet formatclean.🤖 Generated with Claude Code