You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(CDPBrowser): deterministic label focus forwarding and per-char key event typing
Clicking a <label> via the synthetic click path now explicitly focuses its
associated control (htmlFor lookup, else the first focusable descendant)
after el.click(), mirroring native label-activation behavior that Obscura
doesn't implement. This makes focus deterministic after I.click('Name')-style
label clicks and fixes the flakiness previously worked around with skips.
type() now dispatches a real keydown/keypress/input/keyup sequence per
character instead of setting el.value directly, and mutates textContent for
contenteditable hosts instead of a non-existent .value — closing a review
finding that the old implementation bypassed both real key events and the
contenteditable path. Delay pacing is unchanged (one client call per
character, real setTimeout between them).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: test/helper/webapi.js
-7Lines changed: 0 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1019,7 +1019,6 @@ export function tests() {
1019
1019
describe('#type',()=>{
1020
1020
beforeEach(function(){
1021
1021
if(I.capabilities?.layout==='none')this.skip()// clicking does not move real focus without a layout engine, so there is no activeElement to type into
1022
-
if(isHelper('Obscura'))this.skip()// clicking a <label> to focus its associated field is non-deterministic on Obscura (verified: document.activeElement sometimes moves to the field, sometimes stays <body>, across otherwise-identical repeated runs), so typing has no reliable target
1023
1022
})
1024
1023
1025
1024
it('should type into a field',async()=>{
@@ -2582,11 +2581,6 @@ export function tests() {
2582
2581
})
2583
2582
2584
2583
it('should not throw NonFocusedType when element is focused',asyncfunction(){
2585
-
// I.click('Name') clicks the <label for="name"> to forward focus to its associated input —
2586
-
// already-documented as non-deterministic on Obscura (document.activeElement sometimes
2587
-
// moves to the field, sometimes stays <body>, across otherwise-identical repeated runs),
2588
-
// same root cause as the #type describe's Obscura guard.
2589
-
if(isHelper('Obscura'))this.skip()
2590
2584
awaitI.amOnPage('/form/field')
2591
2585
I.options.strict=true
2592
2586
awaitI.click('Name')
@@ -2615,7 +2609,6 @@ export function tests() {
2615
2609
})
2616
2610
2617
2611
it('should not throw for Ctrl+A when element is focused',asyncfunction(){
2618
-
if(isHelper('Obscura'))this.skip()// same label-click focus non-determinism as "should not throw NonFocusedType when element is focused" above
0 commit comments