MCPcopy Create free account
hub / github.com/microsoft/SandDance / getActiveElement

Function getActiveElement

docs/external/js/react-dom.development.js:6764–6776  ·  view source on GitHub ↗
(doc)

Source from the content-addressed store, hash-verified

6762 }
6763
6764 function getActiveElement(doc) {
6765 doc = doc || (typeof document !== 'undefined' ? document : undefined);
6766
6767 if (typeof doc === 'undefined') {
6768 return null;
6769 }
6770
6771 try {
6772 return doc.activeElement || doc.body;
6773 } catch (e) {
6774 return doc.body;
6775 }
6776 }
6777
6778 /**
6779 * Given any node return the first leaf node without children.

Callers 2

getActiveElementDeepFunction · 0.85
constructSelectEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected