Commit 1a322ca6 authored by pythongosssss's avatar pythongosssss
Browse files

Fix scaled position

parent 32fd39b4
...@@ -111,9 +111,13 @@ app.registerExtension({ ...@@ -111,9 +111,13 @@ app.registerExtension({
// Focus the filter box when opening // Focus the filter box when opening
filter.focus(); filter.focus();
// If the top is off screen then shift the element const rect = this.root.getBoundingClientRect();
if (parseInt(this.root.style.top) < 0) {
this.root.style.top = 0; // If the top is off screen then shift the element with scaling applied
if (rect.top < 0) {
const scale = 1 - this.root.getBoundingClientRect().height / this.root.clientHeight;
const shift = (this.root.clientHeight * scale) / 2;
this.root.style.top = -shift + "px";
} }
}); });
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment