jQuery Focus fails on firefox

前端 未结 4 1164
既然无缘
既然无缘 2020-11-27 07:34

I\'ve been some testing reserching for this other question, when I noticed something very peculiar. FF4/5 fail to fire the focus jQuery event. The other questio

4条回答
  •  伪装坚强ぢ
    2020-11-27 07:53

    The manual says aboult .focus() call

    This method is a shortcut for .trigger('focus')

    and from the .trigger() topic

    Although .trigger() simulates an event activation, complete with a synthesized event object, it does not perfectly replicate a naturally-occurring event.

    So as I understand it, the call $(this).focus(); is supposed to trigger the OnFocus event (if there is one attached to the object) but is not quaranteed to actually set/change the focused object.

提交回复
热议问题