fix(browse): dispatch change event on fill for change-only validators - #2475
Open
intelliot wants to merge 1 commit into
Open
fix(browse): dispatch change event on fill for change-only validators#2475intelliot wants to merge 1 commit into
intelliot wants to merge 1 commit into
Conversation
Playwright's Locator.fill() sets the value and dispatches an `input` event, but never `change`. Frameworks that validate on `change` (AngularJS ng-change, debounced strength/match checks — e.g. cPanel's Jupiter theme "Add FTP Account" password-match check) never see the update: the DOM value is correct but the framework's own validator still reports a mismatch, and submitting the form re-fails. Dispatch `change` immediately after fill() so those listeners fire, without forcing a blur (which would break fill-then-press-Enter flows that rely on focus staying put). Repro'd against a real cPanel FTP-account form today; the included regression test reproduces the same class of bug with a minimal change-only listener fixture.
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
Author
|
/trunk merge |
|
An error occurred while submitting your PR to the queue: |
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.
Playwright's
Locator.fill()sets the value and dispatches aninputevent, but neverchange. Frameworks that validate onchange(AngularJSng-change, debounced strength/match checks — e.g. cPanel's Jupiter theme "Add FTP Account" password-match check) never see the update: the DOM value is correct but the framework's own validator still reports a mismatch, and submitting the form re-fails even after the field visually looks right.Hit this today driving a real cPanel FTP-account form via
$B fill— two identical password values kept failing "Passwords do not match" until switching to a driver that dispatches real per-keystroke events.Fix: dispatch
changeimmediately afterfill(), without forcingblur(which would breakfill→press Enterflows that rely on focus staying put).Testing: added
browse/test/fill-change-event.test.tswith a minimal change-only-listener fixture reproducing the bug class. Verified the new test fails without the fix (git stash confirmed) and passes with it. Fullbun run testsuite passes clean on this branch.