Why is blur event not fired in iOS Safari Mobile (iPhone / iPad)?

后端 未结 5 1242
感动是毒
感动是毒 2020-12-15 17:46

I\'ve two event handlers bound to an anchor tag: one for focus and blur.

The handlers fire on desktop, but in iphone and ipad only focus is fired correctly. Blur is

5条回答
  •  渐次进展
    2020-12-15 18:37

    The blur event does not fire because when you click outside the anchor tag on a non-clickable element, iOS ignores the click (and the click event does not fire).

    There are a couple of threads regarding this (e.g. .click event not firing in Chrome on iOS). You can fix it by adding cursor: pointer to the or some other element that the click will be performed on.

提交回复
热议问题