Repository navigation
Conversation
snowystinger
reviewed
Dec 1, 2026
| pendingResets.set(element, event) | ||
| } | ||
|
|
||
| function completeUIReset(element: HTMLInputElement | HTMLTextAreaElement) { |
Contributor
There was a problem hiding this comment.
is this "finish UI Reset"? as opposed to complete which might be interpreted as everything
Author
There was a problem hiding this comment.
Yes, finishUIReset is clearer. I renamed the helper and all six call sites in e611b6f. Prettier, lint, type checking, and all 586 Jest tests passed. The toolbox reported the same 18 existing failures.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes #1359. After a native form reset, typing into the same input or textarea starts from the value and selection left by the DOM.
Why
Typing
one, clicking a submit button whose handler prevents submission and callsform.reset(), and then typingtwoyieldsonetwoon the base. The reset clears the DOM value, but the browser does not call the JavaScript value setter, so user-event's cached value and selection survive.How
Observe native reset events in the tree containing prepared controls. Record the reset for the form's associated inputs and textareas, including controls outside the form element. On the next state access after dispatch, clear the cached value, selection, and blur change baseline if the reset completed without cancellation. The DOM supplies the default value and selection. Clearing the cache dispatches no input or change events.
The regression tests cover the submit handler, direct reset, reset button, empty and nonempty defaults, textarea, repeated cycles, cancellation, selection, external controls, unrelated forms, and an open shadow root. This is a patch-level behavior correction with no public API changes.
Validation
b20f4096d57d9539a0307087bb80569bf57b345awithonetwoand passed withtwo. The standalone sequence also reproduced with user-event 14.6.13, Node 26.13.1, and jsdom 31.0.1, and passed with the patched source. On Ubuntu, the built CJS entry reproduced on the base and passed with the patch using Node 22.22.1 and jsdom 20.0.3.npm run setup -s,npm run lint, andnpm run validatepassed. Lint reported the same 66 warnings as the base.CI=true npm run test -- --coverage --runInBandpassed 586 tests in 55 suites and all 79 snapshots.npm run setup:envandnpm run buildpassed. The Windows build hit the same ESM drive-letter URL error on both the patch and the base.CI=true npm run test:toolboxcompleted all 165 suite runs with zero skipped tests, timeouts, or runner errors. All seven new tests passed in every environment. The patch and the clean base reported the same 18 pre-existing failures, also visible in the upstream CI run for the base.GitHub Actions validation passed on the initial commit. The run for
e611b6fis awaiting maintainer approval, with zero jobs started. Latest PR CI runChecklist
This change and PR description were prepared with Codex assistance.