Skip to content

Commit d473be5

Browse files
authored
Merge pull request #314 from Kirysha/patch-2
Added an optional setting to disable symbols on Android
2 parents 78adbe2 + f105a84 commit d473be5

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,14 @@ The editor component. Simply place this component in your view hierarchy to rece
110110
* `pasteAsPlainText`
111111
A boolean value (false as default) that determines if the clipboard paste will keep its format or it will be done as plain text
112112

113+
114+
* `useCharacter`
115+
The option to disable Chinese characters allows you to support English characters without errors on Android. Set to `true` by default for backwards compatibility.
116+
113117
* `defaultHttps`
114118
A boolean value (true as default) that prepends https:// to the start of links
115119

120+
116121
* `onPaste`
117122
Callback clipboard paste value
118123

src/RichEditor.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export default class RichTextEditor extends Component {
5757
initialFocus,
5858
disabled,
5959
styleWithCSS,
60+
useCharacter
6061
defaultHttps,
6162
} = props;
6263
that.state = {
@@ -84,6 +85,7 @@ export default class RichTextEditor extends Component {
8485
firstFocusEnd,
8586
useContainer,
8687
styleWithCSS,
88+
useCharacter,
8789
defaultHttps,
8890
}),
8991
},

src/editor.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ function createHTML(options = {}) {
4141
firstFocusEnd = true,
4242
useContainer = true,
4343
styleWithCSS = false,
44+
useCharacter = true,
4445
defaultHttps = true,
4546
} = options;
4647
//ERROR: HTML height not 100%;
@@ -680,11 +681,15 @@ function createHTML(options = {}) {
680681
}
681682
});
682683
addEventListener(content, 'compositionstart', function(event){
683-
compositionStatus = 1;
684+
if(${useCharacter}){
685+
compositionStatus = 1;
686+
}
684687
})
685688
addEventListener(content, 'compositionend', function (event){
686-
compositionStatus = 0;
687-
paragraphStatus && formatParagraph(true);
689+
if(${useCharacter}){
690+
compositionStatus = 0;
691+
paragraphStatus && formatParagraph(true);
692+
}
688693
})
689694
690695
var message = function (event){

0 commit comments

Comments
 (0)