Repository navigation
Conversation
seaona
marked this pull request as ready for review
November 18, 2026 13:57
itsyoboieltr
approved these changes
Nov 18, 2026
This branch has not been deployed
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.
Description
Toggle components keep the real
<input type="checkbox">, and itsdata-testid, as a 1×1 screen-reader-only element under decorative divs. In MetaMask,ToggleButton(built onreact-toggle-button) passesdataTestIdto that input, somm click --testid basic-functionality-toggletargets an element a user can't click. Playwright's hit-target check keeps failing with<div>…</div> intercepts pointer eventsand retries until the timeout. The click waits the full 15 s and then fails withMM_CLICK_TIMEOUT, and agents fall back to CDPelement.click()workarounds.When the click target is a checkbox or radio no larger than 1 px on either side, the browser driver now clicks the input's label instead (a wrapping
<label>or a single<label for="<id>">). That toggles the input the way a user does, and the result includesclickedLabel: true.findLabelForHiddenControl()insrc/tools/utils/hidden-control.ts. It uses only Playwright locator calls (boundingBox,count,getAttribute, chainedxpath=locators), with no page scripts, so it works where LavaMoat restricts scripts in the page.PlaywrightPlatformDriver.click()clicks the label when one is found. The abort check, the "page closed after click" result, the missing-target fail-fast and the error classification are unchanged.clickedLabel?: booleanadded toClickActionResultandClickResult.SKILL.mdand the README tools table.Out of scope: a hidden input with no label is still clicked as before and times out; there's no visible element we could safely click on the user's behalf. Inputs hidden with
display: noneor a 0×0 box still fail the visibility wait as they do today.Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/AIENG-270
Screenshots
Found here
Manual testing steps
mm click --testid basic-functionality-toggle."clickedLabel": true, and the Basic Functionality modal opens. Before this change it waited 15 s and failed withMM_CLICK_TIMEOUT(<div> intercepts pointer events).mm clickon a normal button or visible checkbox. It is clicked directly, with noclickedLabelfield.Also checked in Chromium against a page reproducing the
react-toggle-buttonDOM:<label for>checkbox works, including an id that contains quotes.