diff --git a/src/components/editorElements/tagInput/view/tagInputView.js b/src/components/editorElements/tagInput/view/tagInputView.js index d6cf6d1e6..02543ace8 100644 --- a/src/components/editorElements/tagInput/view/tagInputView.js +++ b/src/components/editorElements/tagInput/view/tagInputView.js @@ -12,7 +12,6 @@ import globalStyles from '../../../../globalStyles'; const TagInput = ({ value, onChange, - handleIsValid, componentID, handleTagChanged, intl, @@ -57,14 +56,11 @@ const TagInput = ({ handleTagChanged([...cats]); } - - if (handleIsValid) { - handleIsValid(componentID, !!(_text && _text.length)); - } }; const _handleOnBlur = () => { + let cats = []; if (onChange) { - let cats = text.trim().split(' '); + cats = text.trim().split(' '); if (handleTagChanged && cats.length > 0) { cats.length > 10 ? (setWarning(intl.formatMessage({ id: 'editor.limited_tags' })), setHeight(60)) @@ -87,10 +83,6 @@ const TagInput = ({ } onChange(text); } - - if (handleIsValid) { - handleIsValid(componentID, !!(text && text.length)); - } }; return ( diff --git a/src/screens/editor/screen/editorScreen.js b/src/screens/editor/screen/editorScreen.js index 7cb61e954..2fa607844 100644 --- a/src/screens/editor/screen/editorScreen.js +++ b/src/screens/editor/screen/editorScreen.js @@ -131,8 +131,10 @@ class EditorScreen extends Component { } else { isFormValid = get(fields, 'title', '') && + get(fields, 'title', '').length < 255 && (get(fields, 'body', '') || (bodyText && bodyText > 0)) && - get(fields, 'tags', null); + get(fields, 'tags', null) && + get(fields, 'tags', null).length < 10; } this.setState({ isFormValid });