mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-17 20:51:20 +02:00
fix scrolling on slate inside scrollable container that is not a window (#1369)
This commit is contained in:
committed by
Ian Storm Taylor
parent
7ea6d3cbeb
commit
0b70ca85d5
@@ -23,7 +23,7 @@ const OVERFLOWS = [
|
|||||||
function findScrollContainer(el) {
|
function findScrollContainer(el) {
|
||||||
const window = getWindow(el)
|
const window = getWindow(el)
|
||||||
let parent = el.parentNode
|
let parent = el.parentNode
|
||||||
let scroller = window
|
let scroller
|
||||||
|
|
||||||
while (!scroller) {
|
while (!scroller) {
|
||||||
if (!parent.parentNode) break
|
if (!parent.parentNode) break
|
||||||
@@ -38,6 +38,8 @@ function findScrollContainer(el) {
|
|||||||
parent = parent.parentNode
|
parent = parent.parentNode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!scroller) return window
|
||||||
|
|
||||||
return scroller
|
return scroller
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user