Skip to content

Files

Latest commit

 

History

History
23 lines (14 loc) · 504 Bytes

no-global-active-element.md

File metadata and controls

23 lines (14 loc) · 504 Bytes

Pattern: Accessing active element with global

Issue: -

Description

Avoid accessing the active element with a global. Use the ownerDocument property on a node ref instead.

Example of incorrect code:

document.activeElement;

Example of correct code:

ownerDocument.activeElement;

Further Reading