Sfoglia il codice sorgente

don't allow to click on links

Artal Druk 8 anni fa
parent
commit
8b07524110
2 ha cambiato i file con 9 aggiunte e 1 eliminazioni
  1. 1
    1
      package.json
  2. 8
    0
      src/RichTextEditor.js

+ 1
- 1
package.json Vedi File

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.5",
10
+  "version": "0.1.6",
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",

+ 8
- 0
src/RichTextEditor.js Vedi File

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