Clicking on a div's scroll bar fires the blur event in I.E

后端 未结 8 1513
执念已碎
执念已碎 2020-12-06 09:51

I have a div that acts like a drop-down. So it pops-up when you click a button and it allows you to scroll through this big list. So the div has a vertical scroll bar. The

相关标签:
8条回答
  • 2020-12-06 10:07

    Perhaps try adding the tabindex attribute set to -1 to the div node.

    0 讨论(0)
  • 2020-12-06 10:13

    I'm having a similar problem with IE firing the blur event when you click on a scrollbar. Apparently it only happens n IE7 and below, and IE8 in quirksmode.

    Here's something I found via Google

    https://prototype.lighthouseapp.com/projects/8887/tickets/248-results-popup-from-ajaxautocompleter-disappear-when-user-clicks-on-scrollbars-in-ie6ie7

    Basically you only do the blur if you know the person clicked somewhere on the document other than the currently focused div. It's possible to inversely detect the scrollbar click because document.onclick doesn't fire when you click on the scrollbar.

    0 讨论(0)
提交回复
热议问题