jQuery Focus fails on firefox

前端 未结 4 1158
既然无缘
既然无缘 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:38

    I think I ran into this before, and if I recall correctly it seemed to be some kind of reentrancy problem. My impression was that because FF is already in the process of transitioning focus, it won't let you initiate another focus transition. I believe my workaround was something like

    $('#target').focusout(function() {
        setTimeout(function() {
            $(this).focus();
        }, 0);
    });
    

提交回复
热议问题