mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-11-29 22:07:46 +03:00
Merge pull request #1347 from esteemapp/bugfix/editor-selection
Bugfix/editor selection
This commit is contained in:
commit
11ca8e3185
@ -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