mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-20 03:42:24 +02:00
fix(browse): dispatch a change event after fill for change-only validators
Playwright's Locator.fill() dispatches `input` but never `change`, so frameworks that validate on change (AngularJS ng-change, debounced strength/match checks) never saw the filled value — correct in the DOM, failing the framework's own validation. `browse fill` now dispatches `change` after the fill. Failing-first regression test with a change-only password-match fixture included. Contributed by @intelliot (PR #2475). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
0572125a5b
commit
65b577f133
+31
@@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test Page - Change-Only Validator</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Change-Only Validator</h1>
|
||||
|
||||
<!--
|
||||
Minimal repro of AngularJS ng-change / debounced cross-field validators
|
||||
(e.g. cPanel's Jupiter theme "Add FTP Account" password-match check):
|
||||
the listener only reacts to `change`, never `input`. A page like this
|
||||
silently "loses" a Playwright-style value-set-without-a-change-event.
|
||||
-->
|
||||
<input type="password" id="password" name="password">
|
||||
<input type="password" id="password2" name="password2">
|
||||
<div id="match-status">unknown</div>
|
||||
|
||||
<script>
|
||||
function checkMatch() {
|
||||
var a = document.getElementById('password').value;
|
||||
var b = document.getElementById('password2').value;
|
||||
document.getElementById('match-status').textContent =
|
||||
a && a === b ? 'match' : 'no-match';
|
||||
}
|
||||
document.getElementById('password').addEventListener('change', checkMatch);
|
||||
document.getElementById('password2').addEventListener('change', checkMatch);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user