Skip to content

Fix radio button reset after submitting enhanced form #51796

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

Merged
merged 5 commits into from
Nov 1, 2023

Conversation

surayya-MS
Copy link
Member

@surayya-MS surayya-MS commented Nov 1, 2023

Fix radio button reset after submitting enhanced form

Description

This PR fixes resetting radio button checked property after submitting an enhanced form.

<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
  • No

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

Risk

  • High
  • Medium
  • Low

This is a minor change. We have similar logic for checkbox approved #50991. There are unit and e2e tests for this change.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

When servicing release/2.1

  • Make necessary changes in eng/PatchConfig.props

@surayya-MS surayya-MS requested a review from a team as a code owner November 1, 2023 09:46
@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Nov 1, 2023
@surayya-MS surayya-MS changed the title Fix radio button reset when submitting enhanced form Fix radio button reset after submitting enhanced form Nov 1, 2023
@SteveSandersonMS SteveSandersonMS self-requested a review November 1, 2023 16:26
Copy link
Member

@SteveSandersonMS SteveSandersonMS left a comment

Choose a reason for hiding this comment

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

The updated fix looks great!

@surayya-MS surayya-MS added the Servicing-consider Shiproom approval is required for the issue label Nov 1, 2023
@ghost
Copy link

ghost commented Nov 1, 2023

Hi @surayya-MS. 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.

@surayya-MS surayya-MS merged commit 4c1262d into dotnet:main Nov 1, 2023
@ghost ghost added this to the 9.0-preview1 milestone Nov 1, 2023
@surayya-MS surayya-MS deleted the enhance-form-radio branch November 1, 2023 18:32
@surayya-MS
Copy link
Member Author

/backport to release/8.0

@ghost
Copy link

ghost commented Nov 6, 2023

Hi @surayya-MS. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context.

Copy link
Contributor

github-actions bot commented Nov 6, 2023

Copy link
Contributor

github-actions bot commented Nov 6, 2023

@surayya-MS an error occurred while backporting to release/8.0, please check the run log for details!

Error: @surayya-MS is not a repo collaborator, backporting is not allowed. If you're a collaborator please make sure your dotnet team membership visibility is set to Public on https://github.com/orgs/dotnet/people?query=surayya-MS

@mkArtakMSFT
Copy link
Contributor

/backport to release/8.0

Copy link
Contributor

github-actions bot commented Nov 6, 2023

Copy link
Contributor

github-actions bot commented Nov 6, 2023

@mkArtakMSFT an error occurred while backporting to release/8.0, please check the run log for details!

Error: @mkArtakMSFT is not a repo collaborator, backporting is not allowed. If you're a collaborator please make sure your dotnet team membership visibility is set to Public on https://github.com/orgs/dotnet/people?query=mkArtakMSFT

@mkArtakMSFT
Copy link
Contributor

@surayya-MS the reason for this error is described here: #36832 (comment)
Please follow the instructions there and try it out yourself - should be fixed.

@surayya-MS
Copy link
Member Author

/backport to release/8.0

@ghost
Copy link

ghost commented Nov 8, 2023

Hi @surayya-MS. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context.

Copy link
Contributor

github-actions bot commented Nov 8, 2023

Copy link
Contributor

github-actions bot commented Nov 8, 2023

@surayya-MS backporting to release/8.0 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: fix radio button reset when submitting enhanced form
Applying: rename test
Applying: new fix
error: sha1 information is lacking or useless (src/Components/Web.JS/src/Services/NavigationEnhancement.ts).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0003 new fix
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

Copy link
Contributor

github-actions bot commented Nov 8, 2023

@surayya-MS an error occurred while backporting to release/8.0, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

@AlexKovynev
Copy link

@mkArtakMSFT @surayya-MS maybe cherry-pick?:)

@ghost
Copy link

ghost commented Nov 14, 2023

Hi @AlexKovynev. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context.

surayya-MS added a commit to surayya-MS/aspnetcore that referenced this pull request Nov 20, 2023
* fix radio button reset when submitting enhanced form

* rename test

* new fix

* Update src/Components/Web.JS/test/DomSync.test.ts

Co-authored-by: Steve Sanderson <[email protected]>

* Update src/Components/Web.JS/src/Rendering/DomMerging/DomSync.ts

Co-authored-by: Steve Sanderson <[email protected]>

---------

Co-authored-by: Steve Sanderson <[email protected]>
@surayya-MS
Copy link
Member Author

@AlexKovynev FYI, the release/8.0 branch has been closed for GA for a while now. These fixes are candidates for the first patch. That is why I didn't hurry to backport them sooner.

@ghost
Copy link

ghost commented Nov 20, 2023

Hi @surayya-MS. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context.

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-consider Shiproom approval is required for the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Radio button checked property not reset after enhanced form request
4 participants