Fix caret position on search phrase (#6861)
This commit is contained in:
parent
917ea371a0
commit
25ee7db6ef
1 changed files with 2 additions and 2 deletions
|
|
@ -46,9 +46,9 @@ const Modifier = ({item, searchRef, searchValue, setSearchValue}: Props) => {
|
|||
setSearchValue(newValue);
|
||||
if (item.cursorPosition) {
|
||||
const position = newValue.length + item.cursorPosition;
|
||||
requestAnimationFrame(() => {
|
||||
setTimeout(() => {
|
||||
searchRef.current?.setNativeProps({selection: {start: position, end: position}});
|
||||
});
|
||||
}, 50);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue