1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-16 20:24:01 +02:00

fix scrolling on slate inside scrollable container that is not a window (#1369)

This commit is contained in:
Irwan Fario Subastian
2017-11-02 12:43:24 +11:00
committed by Ian Storm Taylor
parent 7ea6d3cbeb
commit 0b70ca85d5

View File

@@ -23,7 +23,7 @@ const OVERFLOWS = [
function findScrollContainer(el) {
const window = getWindow(el)
let parent = el.parentNode
let scroller = window
let scroller
while (!scroller) {
if (!parent.parentNode) break
@@ -38,6 +38,8 @@ function findScrollContainer(el) {
parent = parent.parentNode
}
if (!scroller) return window
return scroller
}