popup focus
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user