Note that there are some explanatory texts on larger screens.

plurals
  1. POIE event propagation not behaving as expected with jQuery autocomplete/jScrollPane
    primarykey
    data
    text
    <p>I have a text input field which uses ajax autocompletion. The results are displayed in a jScrollPane panel with a vertical scroll bar.</p> <p>I'm experiencing an IE specific problem where the blur event of the input field is fired when the user clicks on the scroll bar of the jscrollPane dropdown (the up and down arrows of the scroll bar are generated as anchor tags shown below). </p> <p>My understanding is return false should stop the event from propagating, which I expect is why the mousedown and click events both return false for the anchor tags. This works fine in FF and Chrome but not in IE.</p> <p>Although not shown below, I have also tried using the following code in my event but to no avail:</p> <pre><code> e.preventDefault ? e.preventDefault() : e.stop(); e.returnValue = false; e.stopPropagation(); </code></pre> <p>I guess my first question is:</p> <p>Should I expect stop propagation on one type of event to actually stop other types of events from propagating?</p> <p>i.e. if a mousedown event is triggered which returns false, will this prevent blur or focus out events from firing?</p> <p>How can I work around this problem to ensure IE works the same as FF and Chrome?</p> <p>Thanks in advance for your help</p> <pre><code>var rf = function() { return false; }; $('&lt;a&gt;&lt;/a&gt;') .attr({'href':'javascript:;', 'className':'jScrollArrowUp'}) .css({'width':settings.scrollbarWidth+'px'}) .html('Scroll up') .bind('mousedown', function() { currentArrowButton = $(this); currentArrowDirection = -1; onArrowMouseDown(); return false; }) .bind('click', rf) $("#InputBox").blur(function(e) { hasFocus = 0; if (!config.mouseDownOnSelect) { hideResultsNow(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload