瀏覽代碼

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

Artal Druk 8 年之前
父節點
當前提交
669510ed37
共有 2 個檔案被更改,包括 2 行新增2 行删除
  1. 1
    1
      package.json
  2. 1
    1
      src/RichTextEditor.js

+ 1
- 1
package.json 查看文件

@@ -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 查看文件

@@ -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 (