fix(main): pass rect to setMode and remove redundant _positionAnchored call (anchor crash fix)
This commit is contained in:
1 parent
95c655c24c
commit
2ed25c14de
2 files changed
+5
-4
No files matched your search
+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