8000 Fix: Add label detection for UI frameworks like Ant Design (#3742) by jackulau · Pull Request #3758 · browser-use/browser-use · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@jackulau
Copy link
@jackulau jackulau commented Dec 12, 2025

Summary - Labels WITH for attribute are excluded (they activate their associated input, causing interference)

  • Labels WITHOUT for that wrap form controls (input/select/textarea) are detected as interactive
  • Checks up to 2 levels deep for nested inputs (Ant Design uses span > input)
  • Cursor:pointer fallback still works for other label cases

Closes 3742


Summary by cubic

Fix detection of clickable labels in UI frameworks like Ant Design to prevent mis-clicks and enable proper interaction. Addresses Linear #3742.

  • Bug Fixes
    • Excludes labels with a "for" attribute from interactive detection.
    • Detects labels without "for" that wrap input/select/textarea, including nested children up to 2 levels (e.g., span > input).
    • Keeps cursor:pointer fallback for other label cases.

Written for commit da6d58f. Summary will update automatically on new commits.

…owser-use#3742)

- Labels WITH 'for' attribute are excluded early (they activate their
  associated input element, causing interference)
- Labels WITHOUT 'for' that wrap form controls (input/select/textarea)
  are detected as interactive (common UI framework pattern)
- Checks up to 2 levels deep for nested inputs (Ant Design uses span>input)
- Cursor:pointer fallback still works for other label cases

This properly supports Ant Design, Element UI, Material UI, and similar
frameworks that use labels as wrapper components.
8000
@CLAassistant
Copy link
CLAassistant commented Dec 12, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor
@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

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.

2 participants

0