-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
MudSelect: Add FitContent Parameter #10894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MudSelect: Add FitContent Parameter #10894
Conversation
- make FullWidth overrridable (virtual) - create a filler div representing the expected max size of the Select
…om/Anu6is/MudBlazor into 2420-MudSelect-Implement-FullWidth
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (76.92%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## dev #10894 +/- ##
==========================================
- Coverage 91.05% 91.05% -0.01%
==========================================
Files 429 429
Lines 13965 13978 +13
Branches 2698 2703 +5
==========================================
+ Hits 12716 12727 +11
+ Misses 646 645 -1
- Partials 603 606 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
src/MudBlazor.UnitTests.Viewer/TestComponents/Select/SelectTest1.razor
Outdated
Show resolved
Hide resolved
|
So I like the thought behind this and I think we are close but there are two hurdles I see.
As a subset of both of these issues the issue might perhaps be in that the mud-width-content class is on the container, perhaps that's something that should be on your hidden element or at least below container? I didn't spend long enough in it to figure it out though. Also from working with MudInput tirelessly keep in mind the styling (particularly noticable in filled mode) is only ever tracked to the input (for some reason) |
src/MudBlazor.UnitTests.Viewer/TestComponents/Select/MultiSelectWithValueContainZeroTest.razor
Outdated
Show resolved
Hide resolved
I've decided to leave FullWidth as is and introduce FitContent. This should address both issues raised. While you still can't increase the width as you mentioned, I believe fit content conveys that intent. The screenshot is simply the behaviour of setting FullWidth to true, that exists currently. So I'll be leaving the current true/false behaviour of FullWidth intact |
versile2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does exactly what you say it does and doesn't have any negative impact on previous setups. I'm not sure I'm in love with it but it does solve two old issues. Wish we could have made the fullwidth work without negative impact.
|
Hi, would you mind adding some screenshots - Not able to check out the branch and see for myself at the moment |
henon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After fixing the xmldoc I think we are ready to merge.
|
|
Thanks @Anu6is ! |





Description
Currently, there is no way for a
MudSelectto size itself based on its contents. Since theMudSelectItemsaren't rendered until theMudSelectis opened, there actual items and their lengths are unknown to the DOM for sizing. This change introduces the following changesFitContentParametermud-width-contentclass to theMudSelectwhenFitContentistrueSetting
FitContentdoes the followingstyle=max-width: min-contentFullWidthif setMudSelectItemwith the following considerationsClearableiconPlaceholdertextAdornmentTextorAdornmentIconMultiSelectionTextFuncResolves: #2420
Resolves: #10868
FitContent.mp4
Doc entry

How Has This Been Tested?
Visually - updated all test viewer cases to include a
FitContenttoggle. Also reviewed all doc examples withFit Contentset to falseType of Changes
Checklist
dev).