修复使用中文输入法不会触发搜索提示的问题

master
落雨楓 2 years ago
parent 3ed72445d5
commit 70fbbb3641

@ -133,14 +133,18 @@ $(function(){
dom.setSelectionRange(selectionStart, selectionEnd); dom.setSelectionRange(selectionStart, selectionEnd);
} }
} }
$('#searchInput, #wpNewTitleMain input, #searchText input[name="search"]').on('input', function(e){ $('#searchInput, #wpNewTitleMain input, #searchText input[name="search"]').on('input', function(e) {
if(!e.originalEvent.isComposing){ if(!e.originalEvent.isComposing){
replaceChars(this); replaceChars(this);
} }
}); });
$('#searchInput, #wpNewTitleMain input, #searchText input[name="search"]').on('compositionend', function(e){ $('#searchInput, #wpNewTitleMain input, #searchText input[name="search"]').on('compositionend', function(e) {
replaceChars(this); replaceChars(this);
}); });
// 修复使用中文输入法不会触发搜索提示的问题
$('#searchInput').on('compositionend', function() {
$(this).trigger('keypress')
});
// 初始化dialog // 初始化dialog
var messageDialog = new OO.ui.MessageDialog(); var messageDialog = new OO.ui.MessageDialog();

Loading…
Cancel
Save