don't steal focus from the find input on page open
This commit is contained in:
parent
180e813ac4
commit
60a5fb96be
|
@ -65,8 +65,12 @@ function addSections(sections, onAdded = () => {}) {
|
||||||
const isPageLocked = document.documentElement.style.pointerEvents;
|
const isPageLocked = document.documentElement.style.pointerEvents;
|
||||||
if (divs[0] && (isPageLocked ? divs.length === sections.length : index === 0)) {
|
if (divs[0] && (isPageLocked ? divs.length === sections.length : index === 0)) {
|
||||||
makeSectionVisible(divs[0].CodeMirror);
|
makeSectionVisible(divs[0].CodeMirror);
|
||||||
|
setTimeout(() => {
|
||||||
|
if ((document.activeElement || {}).localName !== 'input') {
|
||||||
divs[0].CodeMirror.focus();
|
divs[0].CodeMirror.focus();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,11 @@ function createSourceEditor(style) {
|
||||||
initHooks();
|
initHooks();
|
||||||
initAppliesToLineWidget();
|
initAppliesToLineWidget();
|
||||||
|
|
||||||
// focus must be the last action, otherwise the style is duplicated on saving
|
setTimeout(() => {
|
||||||
|
if ((document.activeElement || {}).localName !== 'input') {
|
||||||
cm.focus();
|
cm.focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function initAppliesToLineWidget() {
|
function initAppliesToLineWidget() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user