MCPcopy Create free account
hub / github.com/reactjs/react-rails / getActiveElement

Function getActiveElement

lib/assets/react-source/development/react.js:10336–10348  ·  view source on GitHub ↗
(doc)

Source from the content-addressed store, hash-verified

10334 }
10335
10336 function getActiveElement(doc) {
10337 doc = doc || (typeof document !== 'undefined' ? document : undefined);
10338
10339 if (typeof doc === 'undefined') {
10340 return null;
10341 }
10342
10343 try {
10344 return doc.activeElement || doc.body;
10345 } catch (e) {
10346 return doc.body;
10347 }
10348 }
10349
10350 /**
10351 * 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