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 ?
The blur event fires when an element has lost focus. The main difference between this event and focusout is that focusout bubbles while blur does not. The opposite of blur is focus . This event is not cancelable and does not bubble.
If you want to prevent the blur event from being fired, you have to do so when you are inside the mousedown event, you can do so by invoking the method preventDefault() on the event. Click the checkbox, focus input & then click the button, the textfield never loses focus now.
blur( [eventData ], handler ) An object containing data that will be passed to the event handler. A function to execute each time the event is triggered.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With