Repository navigation
fix(web): list a checkbox or radio its own label draws over no box - #1595
Conversation
…bel covers it Element Plus hides the native input under its label's styled spans or gives it no box, so Playwright's hit-target check refused it. check, uncheck, and tap now click the label at the input's point when the element at that point is the label's own content, or the input's first label with a box when the input has none; anything else on top, a disabled input, an input on top itself, or a boxless input whose labels are all hidden is clicked as before. One in-page read decides whether a label stands in, so a tap on anything else pays that read and keeps locator.click, under one deadline. A locator that never appears still fails NOT_ACTIONABLE within one timeout. Fixes e2e-inc#1276 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ls, and links over the input A control a disabled fieldset holds is refused by :disabled, not only the attribute. A boxless control picks a label that is rendered (checkVisibility), since visibility: hidden keeps its box. No label stands in when the element at the click point, the input's centre or a boxless label's centre, is a link, button, or other interactive descendant of the label: the click would press that instead, and a tap could follow a link. The locator's label resolution runs under the action's remaining deadline. Docs: uncheck reaches a checkbox only, the boxless case needs a visible label, and a link or button in the label still fails. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…n unrendered control The stand-in was decided once from elementFromPoint, so a loading mask on top, or a dialog not open yet, sent the click to the input, which its label then covered until the deadline. The choice now reads the stack at the input's point past anything outside the control and its labels, so Playwright's checks on the label wait the mask out, and is polled while nothing of the control is rendered, failing NOT_ACTIONABLE at the deadline. One evaluateHandle returns the label itself, so the index and the second resolve are gone. A point outside the label's box clicks the input as before, and a tap on anything else returns before scrolling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…se the null handle The surface abandons a cancelled or timed-out operation without stopping it, so a stand-in read still in flight went on to click. The signal is now checked right before both click paths. The handle `pickStandIn` returns for a control clicked as itself is disposed instead of living until the page navigates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… cast A `let` initialised to `null` narrows to `null`, and TypeScript does not see the assignment inside the poll callback, so the old code needed an `as` cast and a comment. Declared without an initialiser, the variable keeps its declared type after the poll. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each "still refuses" case waited out the 2s deadline twice (check, then tap). `perform` now takes a timeout, and those cases pass 500ms. The file drops from about 102s to 48s locally. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-label # Conflicts: # packages/web/src/actions.ts
…rved ref does Since e2e-inc#1571 an observed ref's handle is made on first use from the walk's in-page array. Building the check-actions element target the same way runs every label stand-in case on the path an agent step takes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Element Plus shrinks its native checkbox to a 0x0 box under the label it draws. Chrome's accessibility tree lists the control, and the tree leaves it out, so an agent sees the label text with no checkbox and no state (e2e-inc#1593). This page fails the cross-check with five `chrome missing` lines until the reader lists the labelled ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reader treats a box with no width or height as hidden, as Playwright's `toBeVisible` does, and leaves hidden elements out of the observation. Element Plus shrinks its native checkbox to 0x0 under the box its label draws, so the agent saw the label text with no checkbox and no checked state, and a tap that ticked it reported no change (e2e-inc#1593). The walk now lists such a control while a label of its own renders, and marks it not hidden, as it does a select's options. Chrome's accessibility tree keeps the input, so the cross-check agrees on the labelled ones. A shrunk control with no rendered label element still shows a person nothing and stays out, recorded in expected.txt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…locator calls hidden Agent code skips a node whose hidden state is true, so the listed control must read as shown, while the locator path keeps Playwright's visibility. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…der does, and say locators still call it hidden Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 11 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
The hit check runs at the point the click lands, so a cover elsewhere over the drawn box does not fail it, and uncheck refuses a native radio before any click. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fix/web-list-boxless-checkbox
|
Note 🤖 Claude Opus 5.5 responding on behalf of samanyudas Ready for human review on
|
okwasniewski
left a comment
There was a problem hiding this comment.
Automated review by Claude Code on behalf of maintainers.
Reviewed only the commits after dd7d3580 (head ae1dfada). The fix is small and well scoped. display:none, closed <details> and visibility:hidden inputs still stay hidden, so only the zero-box case gets listed. The per-node cost is negligible. Two things need changing first.
Must fix
- Three guards in
isDrawnByLabel(read-semantics.ts:1116-1117) are untested. I removed each one in turn, andread-node-checked,visibilityandcrosscheckall still passed:style.visibility !== 'visible': without it,<label><input style="opacity:0;width:0;height:0;position:absolute;visibility:hidden" type=checkbox>Agree</label>gets listed. Chrome drops it, so the cross-check would silently drift. Please add this case to thecontrols drawn by their labelfixture or toread-node-checked.test.ts.isSkippedContent(el): without it, an input inside acontent-visibility:hiddenregion with afor=label outside that region gets listed.- The checkbox/radio type check: without it, any zero-box input with a label gets listed.
- The reader lists a checkbox that #1355's tap can't reach. The reader and
pickStandIninactions.tseach check "a label of its own renders", and they disagree ondisplay:contentslabels.- The reader uses
!isHidden(label), which counts adisplay:contentslabel as visible when a child is. pickStandInneeds a non-emptygetBoundingClientRect(), which adisplay:contentslabel never has.- Probe:
<label style="display:contents"><input class=shrunk type=checkbox><span class=box></span>Agree</label>. The reader listscheckbox "Agree", and a tap on it fails withNOT_ACTIONABLE: the control and its labels are not visibleonce the full timeout runs out. - Before this PR the agent tapped the text, which works, so this case is a regression.
- Please use one predicate for both, or at least make both treat
display:contentsthe same way, and add a test.
- The reader uses
Nits
- A disabled box-less checkbox is listed as disabled, which is right. Tapping it fails with
element is not visibleinstead of a not-enabled error, becausepickStandInreturns null for:disabledand the tap falls back to the input. - The
isDrawnByLabelJSDoc is longer than repo norm. - The docs and changeset rely on #1355 ("a tap on it clicks the label"), so #1355 has to land first, as the body says.
Ran: clean tsc and oxlint. Vitest on read-node-checked, visibility, check-actions, crosscheck, observation and read-node-states: 147 passed. Mutations: 4 of 7 caught (dropping the hidden=false override, ignoring whether the label renders, needing no label, reverting the whole fix). The 3 above survive. Probed 12 edge cases against Chrome's accessibility tree.
For the maintainer: scope is the zero-box case only. CSS checkboxes that hide the input with visibility:hidden or display:none and draw the box with label::before stay invisible to the agent, as in Chrome's tree. Chrome lists aria-labelledby-only controls, and controls whose 0-size label has overflowing text. The reader lists neither, and expected.txt doesn't record them.
This was an automated review.
The reader listed a box-less checkbox under a `display: contents` label, which counts as shown while a child paints. A tap clicks the label in its place (`pickStandIn`), which needs a box the label never has, so the tap failed `the control and its labels are not visible` where tapping the label text used to work. The reader now counts only a label with a box. Tests pin each guard of `isDrawnByLabel`: visibility, a slotted input in skipped content, the checkbox or radio type, and the `display: contents` label. A new action test taps every checkbox or radio an observation lists over no box. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A tap on a box-less checkbox clicks its label, and `pickStandIn` refuses
when the label's centre lands on a link, so the click follows no link.
The reader still listed such a checkbox ("Accept the Terms and
Conditions" in Element Plus), and its tap failed `element is not
visible`. The reader now counts only a label that holds no link or
control besides its own, which is stricter than the tap, so it lists no
checkbox the tap refuses.
The action test now uses only box-less controls and checks each one has
no box. The docs say when the agent sees only the label text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 6 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
okwasniewski
left a comment
There was a problem hiding this comment.
Automated review (agent-run triage).
Re-review of a29cc91. Both earlier must-fixes are done:
- The three guards are tested.
- A
display: contentslabel is skipped, and the newcheck-actionstest taps every listed checkbox.
All 9 mutations are caught. The link exclusion doesn't regress anything: on main and #1355 a zero-box input was never listed, and a normal-input terms checkbox behaves the same as before. One gap is left.
Must fix
- An interactive label is not checked. At
read-semantics.ts:1118-1123the reader runslabel.querySelectorAll(INTERACTIVE), which never checks the label element itself.pickStandIn(actions.ts:123-124) useshit.closest(INTERACTIVE), which does match the label.- Probe:
<label class="el-checkbox" role="button">around a zero-box input. On this branch it is listed ascheckbox "Agree", and tapping it fails withNOT_ACTIONABLEafter the full timeout. - On main and #1355 the checkbox isn't listed, and tapping the label text checks it, so this is a regression.
- The same applies to
role="link"andcontenteditablelabels. - Fix: add
!label.matches(INTERACTIVE) &&to the predicate, plus a case in the "leaves out..." test.
- Probe:
Nits
expected.txt:6and theisDrawnByLabelJSDoc say the tap "refuses when the label holds a link". It only refuses when the label's centre lands on one. The reader's stricter rule is fine, but the wording should match.- Still open from before: tapping a disabled zero-box checkbox fails with "not visible", and #1355 lands first.
Ran
- Vitest on read-node-checked, visibility, check-actions, crosscheck, observation, read-node-states and actions: 187 passed.
- tsc and oxlint: clean.
- Range-diff against ae1dfad: only the two new commits changed.
…box's label Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note 🤖 Claude Opus 5.5 responding on behalf of samanyudas Both must-fix items from @okwasniewski's review are addressed in 6273827 and a29cc91. CI passed on a29cc91, and 0dab444 after it changes one docs sentence. Again, review only the commits after Untested guards. Each guard in
The reader listed a checkbox the tap could not reach. The reader now counts a label only when
Through the built
Nits.
Not done here. A checkbox under a label with a link is now left out rather than listed and tappable. Listing it would need #1355's |
A locator that matches another control after the state read must still click the control it read. Removing the pinned element from setChecked fails the new case. uncheck on an Element Plus checkbox clears it through its label, and on an Element Plus radio it is refused with no click. Turning the label stand-in off fails it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ntrol A label with role="button", role="link", or contenteditable listed its box-less checkbox, but a tap on it fails NOT_ACTIONABLE, because pickStandIn's closest() check matches the label itself. The reader now skips such a label too, so the agent taps the label, as on main. The JSDoc, the cross-check reason, and docs/web.mdx now say the tap refuses only when the label's centre lands on a link, and that the reader's rule is stricter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fix/web-list-boxless-checkbox
|
Note 🤖 Claude Opus 5.5 responding on behalf of samanyudas The interactive-label must-fix is in 5ca7075. fe9bd76 merges #1355's new test commit.
I checked your probe through the built
The Ran: Still left for #1355: a tap on a disabled box-less checkbox fails with "not visible". |
Re-checked at Optional nits:
Maintainers, follow-up: the |
Asks addressed in 5ca7075 (automated re-review).
No worries! |
* Click a checkbox or radio through its own label (upstream e2e-inc/e2e#1595) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Throw on cancel before the plain click in ClickControlAsync Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Restart CI Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
…1571) * Click a checkbox or radio through its own label (upstream e2e-inc/e2e#1595) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Throw on cancel before the plain click in ClickControlAsync Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Extract isDrawnByLabel so a box-less checkbox or radio is listed only when its label draws it (upstream e2e-inc/e2e#1595) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
What and why
<label>draws (.el-checkbox__original { opacity: 0; width: 0; height: 0; position: absolute; z-index: -1 }).isHidden(packages/web/src/in-page/read-semantics.ts) treats a box with no size as hidden, and the walk lists only elements that are not hidden. So the agent sawboxandtext="Agree", with no checkbox and no checked state. A tap that ticked the box reported "No listed node changed".isDrawnByLabel). The node is marked not hidden, as the walk already does for a closed select's options, because agent code skips hidden nodes (packages/e2e/src/agent/reading.ts:64).pickStandIninpackages/web/src/actions.ts, from fix(web): check a radio or checkbox through its own label when the label covers it #1355). So a label counts only when that click can work: it has a box of its own (notdisplay: contents) and holds no link or other control besides its own.pickStandInrefuses a label whose centre lands on a link, so the reader rule is the stricter of the two. A checkbox under such a label stays out, as before this PR, and the agent reaches it through the label text or the drawn box.screen.getByRole('checkbox', 'Agree')still reads the input as hidden, as Playwright'stoBeVisibledoes.display: contentslabel, and the label holding a link are recorded intests/crosscheck/expected.txtwith the reason.Issue
Fixes #1593
Verified
Ran it locally: yes
e2e mcpfrom the built packages, on the Element Plus checkbox page from web: the observation drops a checkbox whose input has a 0x0 box (Element Plus el-checkbox) #1593:observe,tapthe checkbox (or the label text when no checkbox is listed),run_codeexpect(...).toBeChecked(), thencheckfalse and true.dd7d3580)#n2 box,#n3 text="Agree": no checkbox#n2 checkbox "Agree"#n2 checkbox "Agree"tap #n3:No listed node changed within the wait after this action, thoughtoBeChecked()then passestap #n2:changed #n2 checkbox "Agree" [checked]tap #n2 failed: ACTION_FAILED: tap did not become actionable in time: elementHandle.click: Timeout 2750ms exceeded. element is not visiblecheck false:changed #n2 checkbox "Agree" (was: ... [checked]),check:[checked]againcheck #n2 failed: ... element is not visiblee2e mcpon a page with the Element Plus checkbox, the same box under adisplay: contentslabel, and an Element Plus "Accept the Terms and Conditions" label holding a link:ae1dfada)a29cc91f)#n2 checkbox "Agree",tap #n2:[checked]display: contentslabel#n6 checkbox "Contents",tap #n6 failed: ACTION_FAILED: tap did not become actionable in time: the control and its labels are not visibletapontext="Contents"ticks it,toBeChecked()passes#n7 checkbox "Accept the Terms and Conditions",tap #n7 failed: ACTION_FAILED: ... element is not visibletapon the drawnboxticks it,toBeChecked()passes. Atapon the label text lands on the link (path/#went), as on maincheck-actions.test.tstaps every checkbox or radio an observation lists over no box, so a reader rule that lists one the tap refuses fails it. Removing any guard inisDrawnByLabel(visibility, skipped content of a slotted input, the type check,display: contents, the link check, the control's own exclusion) fails at least one test.controls drawn by their labelfailed before the fix with fivechrome missinglines and passes after it with the two recorded ones. The benchmark cross-check (CROSSCHECK_BENCHMARK_URL) passes too, so no benchmark scenario's tree moved.read-node-checked.test.tsfails without thehidden = falseoverride (expected true not to be true).--strict-cache,CI=1) has the same 7 failures ondd7d3580and on this branch. All 7 need a model call, and there was noAI_GATEWAY_API_KEYlocally.Checklist
pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only.!, the changeset body names what breaks and what replaces it, and the deprecation warning landed a window earlier (stability policy in CONTRIBUTING.md).docs/**/*.mdxpage for the behavior, andskills/e2e/if the skill describes it..d.tsreviewed,tests/types/sdk-types.tsupdated; wire change edits the schema and both fixtures.e2e/engine): changesets fore2e,@e2e-dev/web, and@e2e-dev/mobile.Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved
🤖 Generated with Claude Code