mirror of
https://github.com/penpot/penpot.git
synced 2025-03-15 17:21:17 -05:00
Merge pull request #1976 from penpot/hiru-fix-scrollintoview
🐛 Fix auto scroll layers panel in firefox
This commit is contained in:
commit
18109b2387
2 changed files with 13 additions and 10 deletions
|
@ -27,6 +27,7 @@
|
|||
- Remove default font on team change
|
||||
- Fix github auth without name
|
||||
- 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
|
||||
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
Element.prototype.scrollIntoViewIfNeeded = function (centerIfNeeded) {
|
||||
centerIfNeeded = arguments.length === 0 ? true : !!centerIfNeeded;
|
||||
|
||||
var parent = this.parentNode,
|
||||
parentComputedStyle = window.getComputedStyle(parent, null),
|
||||
var parent = this.parentNode;
|
||||
if (parent) {
|
||||
var parentComputedStyle = window.getComputedStyle(parent, null),
|
||||
parentBorderTopWidth = parseInt(parentComputedStyle.getPropertyValue('border-top-width')),
|
||||
parentBorderLeftWidth = parseInt(parentComputedStyle.getPropertyValue('border-left-width')),
|
||||
overTop = this.offsetTop - parent.offsetTop < parent.scrollTop,
|
||||
|
@ -22,6 +23,7 @@
|
|||
if ((overTop || overBottom || overLeft || overRight) && !centerIfNeeded) {
|
||||
this.scrollIntoView(alignWithTop);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
})()
|
||||
|
|
Loading…
Add table
Reference in a new issue