fix: preserve explicit empty accessibility names in DOMInteractedElement by neelabhshukla018 · Pull Request #5049 · browser-use/browser-use · GitHub
Skip to content

fix: preserve explicit empty accessibility names in DOMInteractedElement#5049

Open
neelabhshukla018 wants to merge 1 commit into
browser-use:mainfrom
neelabhshukla018:fix-preserve-empty-ax-name
Open

fix: preserve explicit empty accessibility names in DOMInteractedElement#5049
neelabhshukla018 wants to merge 1 commit into
browser-use:mainfrom
neelabhshukla018:fix-preserve-empty-ax-name

Conversation

@neelabhshukla018

@neelabhshukla018 neelabhshukla018 commented Jun 16, 2026

Copy link
Copy Markdown

Summary

This PR fixes an edge case in DOMInteractedElement.load_from_enhanced_dom_tree where an explicit empty accessibility name ("") is treated the same as None due to an implicit truthiness check.

Changes

  • Replaced:

    if enhanced_dom_tree.ax_node and enhanced_dom_tree.ax_node.name:

    with:

    if enhanced_dom_tree.ax_node and enhanced_dom_tree.ax_node.name is not None:
  • This preserves intentionally empty accessibility names while still correctly handling None.

Related Issue

Fixes #5041.


Summary by cubic

Preserves explicit empty accessibility names ("") when building DOMInteractedElement from an enhanced DOM tree by checking for None instead of truthiness. This prevents deliberate empty names from being overwritten as None.

Written for commit a27bd87. Summary will update on new commits.

Review in cubic

@CLAassistant

CLAassistant commented Jun 16, 2026

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

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.

[Bug] Potential loss of empty accessibility names due to implicit truthiness check in views.py

2 participants