Просмотр исходного кода

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

Artal Druk 8 лет назад
Родитель
Сommit
669510ed37
2 измененных файлов: 2 добавлений и 2 удалений
  1. 1
    1
      package.json
  2. 1
    1
      src/RichTextEditor.js

+ 1
- 1
package.json Просмотреть файл

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

+ 1
- 1
src/RichTextEditor.js Просмотреть файл

172
   }
172
   }
173
 
173
 
174
   _renderModalButtons() {
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
     const containerPlatformStyle = PlatfomIOS ? {justifyContent: 'space-between'} : {paddingTop: 15};
176
     const containerPlatformStyle = PlatfomIOS ? {justifyContent: 'space-between'} : {paddingTop: 15};
177
     const buttonPlatformStyle = PlatfomIOS ? {flex: 1, height: 45, justifyContent: 'center'} : {};
177
     const buttonPlatformStyle = PlatfomIOS ? {flex: 1, height: 45, justifyContent: 'center'} : {};
178
     return (
178
     return (