Skip to content

Fix using elementId in handleElementFocus script#4442

Merged
bgoncal merged 1 commit intohome-assistant:mainfrom
wendevlin:fix-handleElementFocus
Mar 23, 2026
Merged

Fix using elementId in handleElementFocus script#4442
bgoncal merged 1 commit intohome-assistant:mainfrom
wendevlin:fix-handleElementFocus

Conversation

@wendevlin
Copy link
Copy Markdown
Member

@wendevlin wendevlin commented Mar 19, 2026

Summary

Screenshots

Link to pull request in Documentation repository

Documentation: home-assistant/companion.home-assistant#

Any other notes

Copilot AI review requested due to automatic review settings March 19, 2026 13:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes the injected handleElementFocus JavaScript so elementId is defined within the script (avoiding a ReferenceError when building the return string), related to frontend issue home-assistant/frontend#30048.

Changes:

  • Define const elementId in the injected JS and pass it into findElementInShadowDOM(...).
  • Simplify the “not found” return path to a single return statement.
  • Minor JS iteration style change (for (const el of ...)).

@bgoncal bgoncal merged commit a5d59da into home-assistant:main Mar 23, 2026
9 of 10 checks passed
@bgoncal
Copy link
Copy Markdown
Member

bgoncal commented Mar 23, 2026

@wendevlin It's not really needed I guess, it was more a debug thing, I will remove it

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@31b2db4). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff           @@
##             main   #4442   +/-   ##
======================================
  Coverage        ?       0           
======================================
  Files           ?       0           
  Lines           ?       0           
  Branches        ?       0           
======================================
  Hits            ?       0           
  Misses          ?       0           
  Partials        ?       0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ReferenceError: Can't find variable: elementId crashes iOS companion app on device/integration pages (2026.3)

3 participants