16

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

$('#textBox').blur(function () { console.log('blur'); })

When I click on a page area out of the textbox, desktop browsers fire this event, but iPad Safari does not. And neither the keyboard nor the cursor does not disappear. Are there any ways to "enable" the blur event ?

Eugene Gluhotorenko
  • 3,094
  • 2
  • 33
  • 52

2 Answers2

4

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

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

document.getElementById("container").addEventListener("click", () => {
  document.getElementById("container").focus();
});
Kevin Farrugia
  • 6,431
  • 4
  • 38
  • 61