mirror of
https://github.com/penpot/penpot.git
synced 2025-02-15 19:48:22 -05:00
🐛 Fix auto scroll layers panel in firefox
This commit is contained in:
parent
8d1cd2f56d
commit
a0cc8a06b6
2 changed files with 13 additions and 10 deletions
|
@ -19,6 +19,7 @@
|
||||||
- Remove default font on team change
|
- Remove default font on team change
|
||||||
- Fix github auth without name
|
- Fix github auth without name
|
||||||
- Fix problems with font loading in Firefox 95
|
- Fix problems with font loading in Firefox 95
|
||||||
|
- Fix auto scroll layers in Firefox [Taiga #3531](https://tree.taiga.io/project/penpot/issue/3531)
|
||||||
|
|
||||||
## 1.13.2-beta
|
## 1.13.2-beta
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,9 @@
|
||||||
Element.prototype.scrollIntoViewIfNeeded = function (centerIfNeeded) {
|
Element.prototype.scrollIntoViewIfNeeded = function (centerIfNeeded) {
|
||||||
centerIfNeeded = arguments.length === 0 ? true : !!centerIfNeeded;
|
centerIfNeeded = arguments.length === 0 ? true : !!centerIfNeeded;
|
||||||
|
|
||||||
var parent = this.parentNode,
|
var parent = this.parentNode;
|
||||||
parentComputedStyle = window.getComputedStyle(parent, null),
|
if (parent) {
|
||||||
|
var parentComputedStyle = window.getComputedStyle(parent, null),
|
||||||
parentBorderTopWidth = parseInt(parentComputedStyle.getPropertyValue('border-top-width')),
|
parentBorderTopWidth = parseInt(parentComputedStyle.getPropertyValue('border-top-width')),
|
||||||
parentBorderLeftWidth = parseInt(parentComputedStyle.getPropertyValue('border-left-width')),
|
parentBorderLeftWidth = parseInt(parentComputedStyle.getPropertyValue('border-left-width')),
|
||||||
overTop = this.offsetTop - parent.offsetTop < parent.scrollTop,
|
overTop = this.offsetTop - parent.offsetTop < parent.scrollTop,
|
||||||
|
@ -22,6 +23,7 @@
|
||||||
if ((overTop || overBottom || overLeft || overRight) && !centerIfNeeded) {
|
if ((overTop || overBottom || overLeft || overRight) && !centerIfNeeded) {
|
||||||
this.scrollIntoView(alignWithTop);
|
this.scrollIntoView(alignWithTop);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
|
|
Loading…
Add table
Reference in a new issue