Spotlight.focus error
This commit is contained in:
@@ -66,20 +66,17 @@ const disableConsole = () => {
|
||||
};
|
||||
|
||||
const originFocus = Spotlight.focus;
|
||||
Spotlight.focus = (elem, containerOption) => {
|
||||
const ret = originFocus(elem, containerOption);
|
||||
Spotlight.focus = function (elem, containerOption) {
|
||||
const ret = originFocus.apply(this, [elem, containerOption]); // this 바인딩을 유지하여 originFocus 호출
|
||||
if (ret === true) {
|
||||
const current = Spotlight.getCurrent();
|
||||
const floatLayerNode = document.getElementById("floatLayer");
|
||||
//popupShowing
|
||||
if (floatLayerNode?.childElementCount > 0) {
|
||||
if (floatLayerNode && floatLayerNode.childElementCount > 0) {
|
||||
if (!floatLayerNode.contains(current)) {
|
||||
if (floatLayerNode.lastElementChild) {
|
||||
const spottableNode = floatLayerNode.lastElementChild.querySelector(
|
||||
'[data-spotlight-container="true"]'
|
||||
); //container
|
||||
const spottableNode = floatLayerNode.lastElementChild.querySelector('[data-spotlight-container="true"]');
|
||||
if (spottableNode) {
|
||||
originFocus(spottableNode);
|
||||
originFocus.apply(this, [spottableNode]); // this 바인딩을 유지하여 originFocus 호출
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user