- Complete React app with 7 developer tools - JSON Tool with visual structured editor - Serialize Tool with visual structured editor - URL, Base64, CSV/JSON, Beautifier, Diff tools - Responsive navigation with dropdown menu - Dark/light mode toggle - Mobile-responsive design with sticky header - All tools working with copy/paste functionality
26 lines
729 B
JavaScript
26 lines
729 B
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.getActiveElement = getActiveElement;
|
|
|
|
var _isDisabled = require("../misc/isDisabled");
|
|
|
|
function getActiveElement(document) {
|
|
const activeElement = document.activeElement;
|
|
|
|
if (activeElement != null && activeElement.shadowRoot) {
|
|
return getActiveElement(activeElement.shadowRoot);
|
|
} else {
|
|
// Browser does not yield disabled elements as document.activeElement - jsdom does
|
|
if ((0, _isDisabled.isDisabled)(activeElement)) {
|
|
return document.ownerDocument ? // TODO: verify behavior in ShadowRoot
|
|
|
|
/* istanbul ignore next */
|
|
document.ownerDocument.body : document.body;
|
|
}
|
|
|
|
return activeElement;
|
|
}
|
|
} |