mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-09-01 03:11:44 +02:00
Fixed scroll-to-selection jumping to top on iOS
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
import getWindow from 'get-window'
|
import getWindow from 'get-window'
|
||||||
import isBackward from 'selection-is-backward'
|
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.
|
* CSS overflow values that would cause scrolling.
|
||||||
@@ -58,6 +58,7 @@ function findScrollContainer(el, window) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function scrollToSelection(selection) {
|
function scrollToSelection(selection) {
|
||||||
|
if (IS_IOS) return
|
||||||
if (!selection.anchorNode) return
|
if (!selection.anchorNode) return
|
||||||
|
|
||||||
const window = getWindow(selection.anchorNode)
|
const window = getWindow(selection.anchorNode)
|
||||||
|
Reference in New Issue
Block a user