H5 how to solve the problem of typing without pinyin in iOS native input method caused by composition event?

for example, the following code mainly restricts the input.

var cpLock;
$("-sharpinput").on("compositionstart", function(e) {
    cpLock = true;
});
$("-sharpinput").on("compositionend", function(e) {
    cpLock = false;
});
$("-sharpinput").on("input", function(e) {
    if (!cpLock) {
        if (e.target.value.length - 17 >=0) {
            var txt = $(e.target).val().substring(0, 16);
            $(e.target).val(txt);
            // 16
        }
    }
});

after testing, there is no problem with the third-party input method and the original Ninomiya keyboard in iOS, but switching to the full keyboard will cause the candidate Pinyin to disappear. How to solve it?

reference:

Jun.22,2022
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bbe00c-303ad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bbe00c-303ad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?