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

How to get event when user leaves keyboard on iOS Safari HTML input? - Stack Overflow

programmeradmin5浏览0评论

I have an input where in the browser, when you "type" on the keyboard, it does not update the UI with the input every keystroke. Only when you press "enter" or "blur" out of the input does it process the input and recompute other form values.

That works fine in Chrome on laptop.

However, on iOS Safari, I have to press the "return" button (not "done" button), to trigger the "enter" keyboard event. But when I press "done", my UI doesn't update and recompute stuff, telling me it is not receiving an "onblur" event.

Is there a way to capture on blur, or when the "done" key is pressed, on iOS Safari in the web/HTML? I am using React.js if that matters. I am also using onchange to update my input, not oninput (let me know if I should switch).

发布评论

评论列表(0)

  1. 暂无评论