Use following code in html:
<input id="test" autocomplete="off" inputmode="numeric"/>
<script>
var input = document.getElementById('test');
input.addEventListener('keydown', function(e){
input.value = 34;
})
</script>
Enviroment
iPadOS14 + Safari + Japanese keyboard
Steps:
1. focus on the input to open the keyboard.
2. switch to Japanese keyboard
3. press any number button like 2, 3, etc.
4. it's observered that input value is 342 or 343 instead of 34.
Expected: input value should be 34.
Known workaround:
using setTimeout to update the iput value when key down.
setTimeout(() => {
input.value = 34;
}, 20)
My question is that is there any better solution to solve this issue?