knockout.js - How to data-bind "mousedown" instead of "click" on an HTML button? -


i have following button using data-bind="click: ..." , wondering if @ possible use "mousedown" instead of "click".

<span style="cursor:pointer" class="button button--sm" data-bind="click: setversion9, css: { 'button--primary': isversion9selected()  }">code version 9</span> 

currently when clicking ui button, if press , release of mouse button happens quickly, causes problems switching between text boxes (ie: copies text 1 box on next one). hoping using "mousedown" resolve issue wouldn't have worry clicking button fast.

you can use event binding events don't have first-class-citizen binding as described here.

<span style="cursor:pointer" class="button button--sm"      data-bind="event: { mousedown: setversion9 }, css: { 'button--primary': isversion9selected()  }">code version 9</span> 

Comments

Popular posts from this blog

html - How can i make an element from a bottom stacking context stays in front of another higher stacking context? -

python - TypeError: start must be a integer -

html - href attribute breaking an element -