iPad Safari does not fire blur event

前端 未结 2 2078
心在旅途
心在旅途 2021-02-19 01:06

I have an html input text element in my application with jQuery blur event handler:

$(\'#textBox\').blur(function () { console.log(\'blur\'); })
<
相关标签:
2条回答
  • 2021-02-19 01:34

    Workaround (albeit not recommended): https://codepen.io/kevinfarrugia/pen/rKpRBL

    document.getElementById("container").addEventListener("click", () => {
      document.getElementById("container").focus();
    });
    
    0 讨论(0)
  • 2021-02-19 01:38

    By design, a tap away will remove the hover state but the textbox will remain focused.

    Safari Web Content Guide should help you develop for Safari on IOS devices.

    0 讨论(0)
提交回复
热议问题