android clear crash issue fix

This commit is contained in:
feruz 2020-01-06 07:17:48 +02:00
parent 4c977a8db6
commit 225b560bad

View File

@ -119,13 +119,22 @@ const MarkdownEditorView = ({
inputRef.current.setNativeProps({
text: _text,
});
// Workaround for iOS selection update issue
setTimeout(() => {
const isIos = Platform.OS === 'ios';
if (isIos) {
setTimeout(() => {
inputRef.current.setNativeProps({
selection: _selection,
});
setSelection(_selection);
}, 200);
} else {
inputRef.current.setNativeProps({
selection: _selection,
});
setSelection(_selection);
}, 200);
}
_changeText(_text);
});