allow textinput to work with hosts not supporting textcomposition
This commit is contained in:
parent
75e41746e6
commit
0c03302a6d
1 changed files with 3 additions and 2 deletions
|
|
@ -355,7 +355,7 @@ var TextInput = function(parentNode, host) {
|
|||
|
||||
// COMPOSITION
|
||||
var onCompositionStart = function(e) {
|
||||
if (inComposition) return;
|
||||
if (inComposition || !host.onCompositionStart) return;
|
||||
// console.log("onCompositionStart", inComposition)
|
||||
inComposition = {};
|
||||
host.onCompositionStart();
|
||||
|
|
@ -371,7 +371,7 @@ var TextInput = function(parentNode, host) {
|
|||
|
||||
var onCompositionUpdate = function() {
|
||||
// console.log("onCompositionUpdate", inComposition && JSON.stringify(text.value))
|
||||
if (!inComposition) return;
|
||||
if (!inComposition || !host.onCompositionUpdate) return;
|
||||
var val = text.value.replace(/\x01/g, "");
|
||||
if (inComposition.lastValue === val) return;
|
||||
|
||||
|
|
@ -390,6 +390,7 @@ var TextInput = function(parentNode, host) {
|
|||
};
|
||||
|
||||
var onCompositionEnd = function(e) {
|
||||
if (!host.onCompositionEnd) return;
|
||||
// console.log("onCompositionEnd", inComposition &&inComposition.lastValue)
|
||||
var c = inComposition;
|
||||
inComposition = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue