Skip to content

fix(browse): dispatch change event on fill for change-only validators - #2475

Open
intelliot wants to merge 1 commit into
garrytan:mainfrom
intelliot:fix/browse-fill-dispatch-change-event
Open

fix(browse): dispatch change event on fill for change-only validators#2475
intelliot wants to merge 1 commit into
garrytan:mainfrom
intelliot:fix/browse-fill-dispatch-change-event

Conversation

@intelliot

Copy link
Copy Markdown

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 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 change immediately after fill(), without forcing blur (which would break fillpress Enter flows that rely on focus staying put).

Testing: added browse/test/fill-change-event.test.ts with 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. Full bun run test suite passes clean on this branch.

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.
@trunk-io

trunk-io Bot commented Aug 7, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

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

@intelliot

Copy link
Copy Markdown
Author

/trunk merge

@trunk-io

trunk-io Bot commented Aug 10, 2026

Copy link
Copy Markdown

An error occurred while submitting your PR to the queue: Only users that are a part of this repo's Trunk organization or have write permissions to the repo can submit a PR to the queue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant