Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A quick and dirty way to have the mousewheel only work when the widget has focus is to add <code>if (!this.focused) return;</code> to the top of <code>_mouseWheeled</code> in <code>dijit/form/_Spinner.js</code>.</p> <pre><code>_mouseWheeled: function(/*Event*/ evt){ // summary: // Mouse wheel listener where supported if (!this.focused) return; ... </code></pre> <p>The proper way though would be to extend the widget.</p> <pre><code>// Disable _mouseWheeled when not in focus. require( [ "dojo/_base/lang" , "dojo/_base/event" , "dijit/form/_Spinner" ] , function( lang , event , _Spinner ){ lang.extend(_Spinner, { _mouseWheeled: function(/*Event*/ evt){ // summary: // Mouse wheel listener where supported if (!this.focused) return; event.stop(evt); // FIXME: Safari bubbles // be nice to DOH and scroll as much as the event says to var wheelDelta = evt.wheelDelta / 120; if(Math.floor(wheelDelta) != wheelDelta){ // If not an int multiple of 120, then its touchpad scrolling. // This can change very fast so just assume 1 wheel click to make it more manageable. wheelDelta = evt.wheelDelta &gt; 0 ? 1 : -1; } var scrollAmount = evt.detail ? (evt.detail * -1) : wheelDelta; if(scrollAmount !== 0){ var node = this[(scrollAmount &gt; 0 ? "upArrowNode" : "downArrowNode" )]; this._arrowPressed(node, scrollAmount, this.smallDelta); if(!this._wheelTimer){ clearTimeout(this._wheelTimer); } this._wheelTimer = setTimeout(lang.hitch(this,"_arrowReleased",node), 50); } } }); } ); </code></pre>
    singulars
    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.
    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