Skip to content
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

BaseInput: Validation should not run on blur when ReadOnly = true. #6518

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

Mr-Technician
Copy link
Member

@Mr-Technician Mr-Technician commented Mar 23, 2023

Description

Previously, a readonly field would still run validation on blur. This PR prevents this behavior:

https://try.mudblazor.com/snippet/wacnYnQdporidlIP

How Has This Been Tested?

Unit

Types 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)

Checklist:

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

@Mr-Technician Mr-Technician added the bug Something does not work as intended/expected label Mar 23, 2023
@codecov
Copy link

codecov bot commented Mar 23, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01 🎉

Comparison is base (1deeac0) 91.16% compared to head (9cf7b5c) 91.17%.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #6518      +/-   ##
==========================================
+ Coverage   91.16%   91.17%   +0.01%     
==========================================
  Files         388      392       +4     
  Lines       14790    14836      +46     
==========================================
+ Hits        13483    13527      +44     
- Misses       1307     1309       +2     
Impacted Files Coverage Δ
src/MudBlazor/Base/MudBaseInput.cs 92.15% <100.00%> (+0.15%) ⬆️

... and 30 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@henon
Copy link
Collaborator

henon commented Mar 23, 2023

Makes sense. What about Disabled?

@Mr-Technician
Copy link
Member Author

Mr-Technician commented Mar 23, 2023

Makes sense. What about Disabled?

I'll double-check but I don't believe it's possible to trigger onblur when an input is disabled. That's the big difference between ReadOnly and Disabled.

See: https://try.mudblazor.com/snippet/ckGHEHmdpMLiJPgs

@Mr-Technician Mr-Technician merged commit fe5273d into MudBlazor:dev Mar 23, 2023
@Mr-Technician Mr-Technician deleted the fix/base-input-readonly branch March 23, 2023 16:20
ilovepilav pushed a commit to ilovepilav/MudBlazor that referenced this pull request Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something does not work as intended/expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants