MCPcopy
hub / github.com/reactjs/react-tabs / determineCanUseActiveElement

Function determineCanUseActiveElement

src/components/UncontrolledTabs.jsx:25–44  ·  view source on GitHub ↗
(environment)

Source from the content-addressed store, hash-verified

23let canUseActiveElement;
24
25function determineCanUseActiveElement(environment) {
26 const env =
27 environment || (typeof window !== 'undefined' ? window : undefined);
28
29 try {
30 canUseActiveElement = !!(
31 typeof env !== 'undefined' &&
32 env.document &&
33 env.document.activeElement
34 );
35 // eslint-disable-next-line no-unused-vars
36 } catch (e) {
37 // Work around for IE bug when accessing document.activeElement in an iframe
38 // Refer to the following resources:
39 // http://stackoverflow.com/a/10982960/369687
40 // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12733599
41 // istanbul ignore next
42 canUseActiveElement = false;
43 }
44}
45
46const defaultProps = {
47 className: 'react-tabs',

Callers 1

getChildrenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…