Skip to content

Commit

Permalink
fix(input-item): shorten interval to set cursor position asynchronously
Browse files Browse the repository at this point in the history
  • Loading branch information
xxyan0205 committed Jul 26, 2021
1 parent 6eabfd8 commit d6e4b8b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/input-item/cursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -46,5 +47,5 @@ export function setCursorsPosition(ctrl, pos) {
range.moveStart('character', pos)
range.select()
}
}, 50)
}, 0)
}

0 comments on commit d6e4b8b

Please sign in to comment.