Skip to content

MudCheckBox and MudRadio: Do not grey out when read-only (#9876)#9904

Merged
henon merged 7 commits intoMudBlazor:devfrom
ingkor:dev
Oct 7, 2024
Merged

MudCheckBox and MudRadio: Do not grey out when read-only (#9876)#9904
henon merged 7 commits intoMudBlazor:devfrom
ingkor:dev

Conversation

@ingkor
Copy link
Contributor

@ingkor ingkor commented Oct 4, 2024

Description

Fixes: #9876
Keep the color when MudCheckBox and MudRadio are ReadOnly

I made the condition to grey out MudCheckBox and MudRadio only apply when disabled.

How Has This Been Tested?

Visually (only class altered)

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@github-actions github-actions bot added bug Unexpected behavior or functionality not working as intended PR: needs review labels Oct 4, 2024
@codecov
Copy link

codecov bot commented Oct 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.82%. Comparing base (28bc599) to head (d3ea351).
Report is 513 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #9904      +/-   ##
==========================================
+ Coverage   89.82%   90.82%   +0.99%     
==========================================
  Files         412      412              
  Lines       11878    12868     +990     
  Branches     2364     2487     +123     
==========================================
+ Hits        10670    11687    +1017     
+ Misses        681      618      -63     
- Partials      527      563      +36     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ScarletKuro
Copy link
Member

Can you post before and after pic?

@ingkor
Copy link
Contributor Author

ingkor commented Oct 4, 2024

Before

image

After

image

Can you post before and after pic?

This comment made me realize the Switch changes were not right. I removed them.

@ingkor ingkor changed the title #9876 Removed the grey color on disabling MudCheckBox, MudSwitch and MudRadio #9876 Removed the grey color on disabling MudCheckBox and MudRadio Oct 4, 2024
@dennisrahmen
Copy link
Contributor

@ingkor that feels as inconsistent as it did before to me.

I would think the slightly shaded color of the MudSwitch is quite fitting and could be applied to the other controls.

As now the color is the same as when active, so there is no distinction for the user if the Checkbox should be selectable or not.

@ingkor
Copy link
Contributor Author

ingkor commented Oct 5, 2024

The hover attribute makes the difference. It doesn't react when it's being hovered in readonly now.

However it might be interesting to use a slightly dimmed color (lighten variant).
As it's being done in switch.

Imo this is 1 stepnin the right direction already.

@dennisrahmen
Copy link
Contributor

That does not work on mobile though.

@dennisrahmen
Copy link
Contributor

Wouldn't the issue be fixed if the custom color would override the read only color.

That way if no custom color is set it would still have the preset read only color

@henon henon changed the title #9876 Removed the grey color on disabling MudCheckBox and MudRadio MudCheckBox and MudRadio: Do not grey out when read-only (#9876) Oct 5, 2024
@henon henon requested a review from Garderoben October 5, 2024 16:15
@danielchalmers
Copy link
Member

There was an existing bug in the logic that may cause an additional issue with the colors: #9524 (comment)

@ingkor
Copy link
Contributor Author

ingkor commented Oct 5, 2024

So we could do the lighten variant when disabled? Or not?

@danielchalmers
Copy link
Member

@ingkor Thanks for your work, Will wait for @Garderoben to weigh in

@ScarletKuro ScarletKuro requested review from Garderoben and removed request for Garderoben October 5, 2024 23:34
Copy link
Member

@Garderoben Garderoben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets do it like this. Like @danielchalmers said this is a step in the right direction.

I'm just wondering if CheckBox/Radio/TextFields etc should maybe have the dimmed readonly color like switches does.

@ingkor
Copy link
Contributor Author

ingkor commented Oct 6, 2024

#hacktoberfest eligibility? :D
I could also make a proposal to show the light colors when it's readonly. However I didn't find a library that did this... In a react example it was the same color.

@henon henon added the hacktoberfest Hacktoberfest 2021 label Oct 6, 2024
@henon henon added hacktoberfest-accepted Issues and PRs which were accepted as Hacktoberfest submissions hacktoberfest2024 labels Oct 6, 2024
@henon
Copy link
Contributor

henon commented Oct 6, 2024

#hacktoberfest eligibility?

Of course! Thanks for contributing in Hacktober. I'll merge once @danielchalmers approves as well.

@henon henon merged commit 748250d into MudBlazor:dev Oct 7, 2024
@henon
Copy link
Contributor

henon commented Oct 7, 2024

Thanks @ingkor !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior or functionality not working as intended hacktoberfest Hacktoberfest 2021 hacktoberfest2024 hacktoberfest-accepted Issues and PRs which were accepted as Hacktoberfest submissions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MudRadio : Color apply when just ReadOnly, not disabled

6 participants