mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-11-22 23:28:56 +03:00
Fix for editor selection issue
This commit is contained in:
parent
f945378466
commit
67ebe8fbd2
@ -1,4 +0,0 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: '@react-native-community',
|
||||
};
|
@ -7,7 +7,8 @@
|
||||
"plugin:eslint-comments/recommended",
|
||||
"plugin:import/errors",
|
||||
"plugin:import/warnings",
|
||||
"plugin:jest/recommended"
|
||||
"plugin:jest/recommended",
|
||||
"@react-native-community"
|
||||
],
|
||||
"env": {
|
||||
"browser": true,
|
||||
@ -46,7 +47,7 @@
|
||||
"no-case-declarations": "off",
|
||||
"no-cycle": "off",
|
||||
"react-hooks/rules-of-hooks": "error",
|
||||
"react-hooks/exhaustive-deps": "warn",
|
||||
"react-hooks/exhaustive-deps": "off",
|
||||
"import/no-extraneous-dependencies": [
|
||||
"error",
|
||||
{
|
||||
|
@ -45,13 +45,13 @@ const MarkdownEditorView = ({
|
||||
if (!isPreviewActive) {
|
||||
_setTextAndSelection({ selection: { start: 0, end: 0 }, text });
|
||||
}
|
||||
}, [_setTextAndSelection, isPreviewActive, text]);
|
||||
}, [isPreviewActive]);
|
||||
|
||||
useEffect(() => {
|
||||
if (text === '' && draftBody !== '') {
|
||||
_setTextAndSelection({ selection: { start: 0, end: 0 }, text: draftBody });
|
||||
}
|
||||
}, [_setTextAndSelection, draftBody, text]);
|
||||
}, [draftBody]);
|
||||
|
||||
useEffect(() => {
|
||||
if (editable === null) {
|
||||
@ -63,7 +63,7 @@ const MarkdownEditorView = ({
|
||||
} else {
|
||||
setEditable(!isLoading);
|
||||
}
|
||||
}, [editable, isLoading]);
|
||||
}, [isLoading]);
|
||||
|
||||
useEffect(() => {
|
||||
if (uploadedImage && uploadedImage.url) {
|
||||
@ -75,7 +75,7 @@ const MarkdownEditorView = ({
|
||||
isImage: !!uploadedImage,
|
||||
});
|
||||
}
|
||||
}, [_setTextAndSelection, selection, text, uploadedImage]);
|
||||
}, [uploadedImage]);
|
||||
|
||||
useEffect(() => {
|
||||
setText(draftBody);
|
||||
@ -91,7 +91,7 @@ const MarkdownEditorView = ({
|
||||
handleIsFormValid(text);
|
||||
}
|
||||
}
|
||||
}, [_changeText, handleIsFormValid, text]);
|
||||
}, [text]);
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const _changeText = useCallback(input => {
|
||||
|
Loading…
Reference in New Issue
Block a user