Ver código fonte

don't allow insert of links that's missing either title or URL

Artal Druk 8 anos atrás
pai
commit
669510ed37
2 arquivos alterados com 2 adições e 2 exclusões
  1. 1
    1
      package.json
  2. 1
    1
      src/RichTextEditor.js

+ 1
- 1
package.json Ver arquivo

@@ -7,7 +7,7 @@
7 7
     "type": "git",
8 8
     "url": "https://github.com/wix-private/react-native-ZSSRichTextEditor.git"
9 9
   },
10
-  "version": "0.1.4",
10
+  "version": "0.1.5",
11 11
   "description": "React Native Wrapper for ZSSRichTextEditor",
12 12
   "main": "index.js",
13 13
   "license": "UNLICENSED",

+ 1
- 1
src/RichTextEditor.js Ver arquivo

@@ -172,7 +172,7 @@ export default class RichTextEditor extends Component {
172 172
   }
173 173
 
174 174
   _renderModalButtons() {
175
-    const insertDisabled = this.state.linkTitle.length <= 0;
175
+    const insertDisabled = this.state.linkTitle.trim().length <= 0 || this.state.linkUrl.trim().length <= 0;
176 176
     const containerPlatformStyle = PlatfomIOS ? {justifyContent: 'space-between'} : {paddingTop: 15};
177 177
     const buttonPlatformStyle = PlatfomIOS ? {flex: 1, height: 45, justifyContent: 'center'} : {};
178 178
     return (