From d6e4b8bef83f7c2f4a08c57acf9b1f6f44271c97 Mon Sep 17 00:00:00 2001 From: xuxiaoyan Date: Mon, 26 Jul 2021 14:34:09 +0800 Subject: [PATCH] fix(input-item): shorten interval to set cursor position asynchronously #749 --- components/input-item/cursor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/input-item/cursor.js b/components/input-item/cursor.js index a10f4dd69..a182f3665 100644 --- a/components/input-item/cursor.js +++ b/components/input-item/cursor.js @@ -34,6 +34,7 @@ export function setCursorsPosition(ctrl, pos) { clearTimeout(timer) } + // Compatible with some Android devices, the synchronized settings will be invalid timer = setTimeout(() => { /* istanbul ignore next */ if (ctrl.setSelectionRange) { @@ -46,5 +47,5 @@ export function setCursorsPosition(ctrl, pos) { range.moveStart('character', pos) range.select() } - }, 50) + }, 0) }