1. Controls:
<div class= "Mui-input-row mui-search Search" > <input type= "search" class= "Mui-input-clear" placeholder= "name | license plate number | Frame number | Mobile phone number" id= "seach" ><!--oninput= "Getcustomerbymisskeyword (this.value,1)"--></ Div>
2.js Code
/** modification Reason: Compatible with Apple's native input method;
* 1. Previous effect: onkeyup If it is Pinyin Zhang input after clicking the input keyboard into "Zhang" will not trigger the onkeyup event, Onkeyinput will trigger three times, spaces, sheets
* 2. After the change: if it is the Chinese trigger "compositionend" monitor, if it is other English numbers trigger "input" event
*/
var node = document.queryselector (' #seach '), var inputlock = False;node.addeventlistener (' Compositionstart ', function ( {Inputlock = True;console.log ("compositionstart----->" +this.value);}); Node.addeventlistener (' Compositionend ', function () {Inputlock = false;//calls its own method Console.log ("Compositionend----- > "+this.value);}); Node.addeventlistener (' Input ', function () {if (!inputlock) {console.log ("input----->" +this.value);//Call Own Method}});
Fuzzy query: Chinese compatible native input method of Apple