Skip to content

Conversation

@SteveSandersonMS
Copy link
Member

@SteveSandersonMS SteveSandersonMS commented Sep 28, 2023

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 and checked 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?

  • Yes
  • No

[If yes, specify the version the behavior has regressed from]

Risk

  • High
  • Medium
  • Low

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

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

@SteveSandersonMS SteveSandersonMS requested a review from a team as a code owner September 28, 2023 15:32
@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Sep 28, 2023
@mkArtakMSFT mkArtakMSFT added the Servicing-consider Shiproom approval is required for the issue label Sep 28, 2023
@ghost
Copy link

ghost commented Sep 28, 2023

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.

@mkArtakMSFT mkArtakMSFT added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Sep 28, 2023
@ghost
Copy link

ghost commented Sep 28, 2023

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.

@mkArtakMSFT mkArtakMSFT merged commit e242869 into release/8.0 Sep 28, 2023
@mkArtakMSFT mkArtakMSFT deleted the stevesa/fix-checkbox-dom-sync branch September 28, 2023 22:03
@ghost ghost added this to the 8.0.0 milestone Sep 28, 2023
mkArtakMSFT pushed a commit that referenced this pull request Nov 23, 2023
# [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
3dots pushed a commit to 3dots/aspnetcore-Web.JS that referenced this pull request Feb 19, 2024
# [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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components Servicing-approved Shiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants