// 输入过程
$("input[name=search]").on("input propertychange", function () {
if ($(this).prop('comStart')) return; // 中文输入过程中不截断
searchFn(this);
}).on('compositionstart', function () {
// 中文输入开始
$(this).prop('comStart', true);
}).on('compositionend', function () {
// 中文输入结束
$(this).prop('comStart', false);
searchFn(this);
});
// 处理输入结果事件
let searchFn = (that) => {
// todo
};
网友评论