Browse Source

don't allow to click on links

Artal Druk 8 years ago
parent
commit
8b07524110
2 changed files with 9 additions and 1 deletions
  1. 1
    1
      package.json
  2. 8
    0
      src/RichTextEditor.js

+ 1
- 1
package.json View File

@@ -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.5",
10
+  "version": "0.1.6",
11 11
   "description": "React Native Wrapper for ZSSRichTextEditor",
12 12
   "main": "index.js",
13 13
   "license": "UNLICENSED",

+ 8
- 0
src/RichTextEditor.js View File

@@ -153,6 +153,9 @@ export default class RichTextEditor extends Component {
153 153
                     style={{height: 20}}
154 154
                     onChangeText={(text) => this.setState({linkUrl: text})}
155 155
                     value={this.state.linkUrl}
156
+                    keyboardType="url"
157
+                    autoCapitalize="none"
158
+                    autoCorrect={false}
156 159
                 />
157 160
               </View>
158 161
               {PlatfomIOS && <View style={styles.lineSeparator}/>}
@@ -216,12 +219,17 @@ export default class RichTextEditor extends Component {
216 219
           injectedJavaScript={injectScript}
217 220
           source={pageSource}
218 221
           onLoad={() => this.init()}
222
+          onShouldStartLoadWithRequest={(event) => {return this._onShouldStartLoadWithRequest(event)}}
219 223
         />
220 224
         {this._renderLinkModal()}
221 225
       </View>
222 226
     );
223 227
   }
224 228
 
229
+  _onShouldStartLoadWithRequest(event) {
230
+    return (event.url.indexOf('editor.html') != -1);
231
+  }
232
+
225 233
   escapeJSONString = function(string) {
226 234
     return string
227 235
       .replace(/[\\]/g, '\\\\')