最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - get how many backspaces with on single input event of type deleteContentBackward - Stack Overflow

programmeradmin6浏览0评论

We are making a complex text editor using a contentEditable DIV. On mobile, when virtual keyboard give a suggestion or autocorrects a word, a single input event is first called of type deleteContentBackward before inserting text. This single input event often erase more than one character in that context. How can we get the number of backward deletion of a single input event of type deleteContentBackward using javascript?

Here is the code we use to debug at the moment:

document.getElementById('INPUT').addEventListener('input', (event) => { console.log(event);   

document.getElementById('inputDebugDIV').innerHTML+="event.inputType:"+event.inputType; });
发布评论

评论列表(0)

  1. 暂无评论