(doc: ?Document)
| 8 | */ |
| 9 | |
| 10 | export default function getActiveElement(doc: ?Document): ?Element { |
| 11 | doc = doc || (typeof document !== 'undefined' ? document : undefined); |
| 12 | if (typeof doc === 'undefined') { |
| 13 | return null; |
| 14 | } |
| 15 | try { |
| 16 | return doc.activeElement || doc.body; |
| 17 | } catch (e) { |
| 18 | return doc.body; |
| 19 | } |
| 20 | } |
no outgoing calls
no test coverage detected