Buttons: Remove unnecessary Title, AriaLabel properties#9098
Buttons: Remove unnecessary Title, AriaLabel properties#9098henon merged 8 commits intoMudBlazor:devfrom
Title, AriaLabel properties#9098Conversation
|
@henon @ScarletKuro thoughts on deleting these redundant properties for v7 and keeping a philosophy of only adding properties for attributes when it has concrete values? |
Title, AriaLabel properties
|
If the If |
|
Of course this is always also a performance question. Every parameter adds a bit of overhead. So I guess the question is what is more important, performance or usability. Hard to say. We may be prematurely optimizing. There are usually only a handfull of buttons on every page and I'd say this is the most likely use-case. On the other hand - and I am arguing against what I wrote above - we could just link to the W3C button page in the docs and tell users that all attributes added to |
That could mean not that much overhead at the end. So usability (and consistency) may win against perfomance in this case ? |
@henon The issue is that
I'd agree with that in general because there are so many possible attributes for every component that it would be a never-ending venture to add them all. I don't know if it's our job to teach users about common attributes. |
|
What would the link in the docs look like? We could add it directly to the class XML docs now that #8903 will be added |
you can only have one property with that
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #9098 +/- ##
==========================================
+ Coverage 89.82% 90.63% +0.80%
==========================================
Files 412 399 -13
Lines 11878 12494 +616
Branches 2364 2431 +67
==========================================
+ Hits 10670 11324 +654
+ Misses 681 626 -55
- Partials 527 544 +17 ☔ View full report in Codecov by Sentry. |
|
Added some docs to remind people they have more options for attributes; What do you think? @henon @jperson2000 |
|
@henon @ScarletKuro Does my implementation of |
I was more thinking of the button page in our docs. The XML summary of MudButton is not the main info source for our users. |
|
OK, I guess that will be enough |
henon
left a comment
There was a problem hiding this comment.
I don't know about the ToggledAttributes. Do we really need this just for "title" and "aria-label" which we just decided to remove as parameters?
|
Thanks Daniel! |

Description
The
Titleproperty originated to supply atitleattribute to the internal MudIcon. This is a valid use because it wasn't reachable otherwise. Later in #4280 it was changed to applytitledirectly to the button so the tooltip would appear if hovering over padding and not just the icon, but that rendered the property obsolete because internally both of these are the same:In #8630 I expanded the
Titleproperty toMudBaseButtonwithout questioning the need for it in the first place, but I can't see any reason to have a dedicated property at this point.It has some minor value in the MudToggleIconButton but are we planning on adding every conceivable attribute for convenience? I added
ToggledUserAttributesas a flexible alternative which will cut down on the number of properties.How Has This Been Tested?
unit
Type of Changes
MudBaseButton.TitleMudToggleIconButton.TitleMudToggleIconButton.ToggledTitleMudToggleIconButton.AriaLabelMudToggleIconButton.ToggledAriaLabelChecklist
dev).