forked from Ivasoft/mattermost-mobile
Fix caret position on search phrase (#6861)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user