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