Is there a way to use event.preventDefault with focusOut? If not, why?

前端 未结 4 1257
慢半拍i
慢半拍i 2021-02-07 07:18

I would like to prevent the default event from a focusOut (or blur) event and keep the focus set to the specific input field.

This is what I ha

4条回答
  •  伪装坚强ぢ
    2021-02-07 07:30

    inst.$target.on("blur", function() {
         if (!$.suggestBox.$divCont.hasClass($.suggestBox.mouseOverClassName)) {
            $.suggestBox.$divCont.css({'display': 'none'});   //reposition Suggestbox
            return true;
            } 
          inst.target.focus();
          return false;
             });
    

    need to see your html. I don't think you are calling things correctly EX:

    $.suggestBox I think should be $(".suggestBox") , but i cant tell without seeing your htnl

提交回复
热议问题