mirror of
https://github.com/home-assistant/frontend.git
synced 2026-07-13 09:17:11 +01:00
26bdff9a16
When the async Clipboard API is unavailable or rejects, copyToClipboard falls back to a hidden textarea and execCommand. It appended that textarea to deepActiveElement()?.getRootNode(). When the deepest active element lives in the light DOM, getRootNode() returns the Document node, and appending an element to a Document throws HierarchyRequestError (only the single documentElement is allowed), so the fallback copy silently failed. Append to document.body when the resolved root is a Document. Shadow roots and elements keep holding the textarea directly, preserving execCommand behavior inside dialogs that trap focus.