popup focus

This commit is contained in:
yonghyon
2024-08-07 12:06:03 +09:00
parent fb81e7d9e2
commit b30eb20b0d

View File

@@ -64,6 +64,28 @@ const disableConsole = () => {
console.warn = function () {};
console.info = function () {};
};
const originFocus = Spotlight.focus;
Spotlight.focus = (elem, containerOption) => {
const ret = originFocus(elem, containerOption);
if (ret === true) {
const current = Spotlight.getCurrent();
const floatLayerNode = document.getElementById("floatLayer");
//popupShowing
if (floatLayerNode?.childElementCount > 0) {
if (!floatLayerNode.contains(current)) {
if (floatLayerNode.lastElementChild) {
const spottableNode = floatLayerNode.lastElementChild.querySelector('[data-spotlight-container="true"]'); //container
if (spottableNode) {
originFocus(spottableNode);
}
}
}
}
}
return ret;
};
function AppBase(props) {
const dispatch = useDispatch();
const httpHeader = useSelector((state) => state.common.httpHeader);