-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Fix checkbox DOM sync #50991
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
Fix checkbox DOM sync #50991
Conversation
Hi @SteveSandersonMS. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge. To learn more about how to prepare a servicing PR click here. |
Hi @SteveSandersonMS. This PR was just approved to be included in the upcoming servicing release. Somebody from the @dotnet/aspnet-build team will get it merged when the branches are open. Until then, please make sure all the CI checks pass and the PR is reviewed. |
# [release 8.0] Fix radio button reset after submitting enhanced form Manual backport of #51796 ## Description This PR fixes resetting radio button checked property after submitting an enhanced form. ```html <form data-enhance> <input type="radio" /> <button>Submit</button> </form> ``` Workaround is to remove `data-enhance` attribute. Fixes #51429 ## Customer Impact Without this change customers will have bad experience using enhanced form that contains radio button. Radio button won't get reset after submitting the form. ## Regression? - [ ] Yes - [x] No [If yes, specify the version the behavior has regressed from] ## Risk - [ ] High - [ ] Medium - [x] Low This is a minor change. We have similar logic for checkbox approved #50991. There are unit and e2e tests for this change. ## Verification - [x] Manual (required) - [x] Automated ## Packaging changes reviewed? - [ ] Yes - [ ] No - [x] N/A ---- ## When servicing release/2.1 - [ ] Make necessary changes in eng/PatchConfig.props Fixes #51429
# [release 8.0] Fix radio button reset after submitting enhanced form Manual backport of dotnet/aspnetcore#51796 ## Description This PR fixes resetting radio button checked property after submitting an enhanced form. ```html <form data-enhance> <input type="radio" /> <button>Submit</button> </form> ``` Workaround is to remove `data-enhance` attribute. Fixes #51429 ## Customer Impact Without this change customers will have bad experience using enhanced form that contains radio button. Radio button won't get reset after submitting the form. ## Regression? - [ ] Yes - [x] No [If yes, specify the version the behavior has regressed from] ## Risk - [ ] High - [ ] Medium - [x] Low This is a minor change. We have similar logic for checkbox approved dotnet/aspnetcore#50991. There are unit and e2e tests for this change. ## Verification - [x] Manual (required) - [x] Automated ## Packaging changes reviewed? - [ ] Yes - [ ] No - [x] N/A ---- ## When servicing release/2.1 - [ ] Make necessary changes in eng/PatchConfig.props Fixes #51429
Fix checkbox DOM sync
Unbreaks checkboxes with custom value attributes.
Description
There was a trivial logic error in the DOM syncing code, causing the
value
attribute on checkboxes to get wrongly overwritten in a certain case (if there was a custom value attribute andchecked
was unchanged).Fixes #50995
Customer Impact
In some cases, checkbox values would get corrupted after an enhanced navigation. This would break form functionality.
The specific scenario was "checkboxes with a custom value attribute, when an enhanced nav leaves the
checked
state unchanged".Regression?
[If yes, specify the version the behavior has regressed from]
Risk
Very low because it's a tiny code edit, and only affects a very specific scenario, and the old logic was (in retrospect) definitely incorrect.
Verification
Packaging changes reviewed?