diff --git a/app/client/lib/FocusLayer.ts b/app/client/lib/FocusLayer.ts index 3d2330fc..fbce5b54 100644 --- a/app/client/lib/FocusLayer.ts +++ b/app/client/lib/FocusLayer.ts @@ -82,7 +82,7 @@ class FocusLayerManager extends Disposable { this._focusLayers.push(layer); // Move the focus to the new layer. Not just grabFocus, because if the focus is on the previous // layer's defaultFocusElem, the new layer might consider it "allowed" and never get the focus. - setTimeout(() => layer.defaultFocusElem.focus(), 0); + setTimeout(() => layer.defaultFocusElem.focus({preventScroll: true}), 0); } public removeLayer(layer: FocusLayer) { @@ -121,7 +121,7 @@ class FocusLayerManager extends Disposable { watchElementForBlur(document.activeElement, () => this.grabFocus()); layer.onDefaultBlur(); } else { - layer.defaultFocusElem.focus(); + layer.defaultFocusElem.focus({preventScroll: true}); layer.onDefaultFocus(); } }