1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-30 10:29:48 +02:00

Fixed scroll-to-selection jumping to top on iOS

This commit is contained in:
Sunny Hirai
2018-01-09 13:07:40 -08:00
parent 2d7c470c94
commit d96a528ac0

View File

@@ -1,7 +1,7 @@
import getWindow from 'get-window'
import isBackward from 'selection-is-backward'
import { IS_SAFARI } from '../constants/environment'
import { IS_SAFARI, IS_IOS } from '../constants/environment'
/**
* CSS overflow values that would cause scrolling.
@@ -58,6 +58,7 @@ function findScrollContainer(el, window) {
*/
function scrollToSelection(selection) {
if (IS_IOS) return
if (!selection.anchorNode) return
const window = getWindow(selection.anchorNode)