1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-21 22:45:18 +02:00

Fix scrolling boundary detection (see #3463) (#3678)

This commit is contained in:
Mitchell Busby
2020-05-21 10:32:56 +10:00
committed by GitHub
parent 31709160a3
commit 26fbc1dc41

View File

@@ -176,7 +176,10 @@ export const Editable = (props: EditableProps) => {
if (newDomRange) {
domSelection.addRange(newDomRange!)
const leafEl = newDomRange.startContainer.parentElement!
scrollIntoView(leafEl, { scrollMode: 'if-needed' })
scrollIntoView(leafEl, {
scrollMode: 'if-needed',
boundary: el,
})
}
setTimeout(() => {