fix(main): pass rect to setMode and remove redundant _positionAnchored call (anchor crash fix)
This commit is contained in:
+4
-4
@@ -100,13 +100,13 @@ function start() {
|
||||
const el = findAnchorElement();
|
||||
if (el) {
|
||||
const rect = el.getBoundingClientRect();
|
||||
dialog.setMode('anchored', { canAnchor: true });
|
||||
dialog._positionAnchored(rect);
|
||||
// observe
|
||||
const ro = new ResizeObserver(() => {
|
||||
dialog.setMode('anchored', { canAnchor: true, rect: rect });
|
||||
if (typeof ResizeObserver !== 'undefined') {
|
||||
const ro = new ResizeObserver(function () {
|
||||
if (prefs.mode === 'anchored') dialog._positionAnchored(el.getBoundingClientRect());
|
||||
});
|
||||
ro.observe(el);
|
||||
}
|
||||
anchorError = null;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user