javascript - event.preventDefault() Causing :active pseudo class to not work -


i have react-redux app in each button component in keyboard defined follows:

<button id={id} key={id} classname={classname} data-value={value} ontouchstart={handleaction}>      {displayvalue} </button> 

the handleaction function defined follows:

let handleaction = (e) => {         e.preventdefault();         onaction(value);     }; 

the problem clicked effect of button :active psuedo class not show when use e.preventdefault() in handler. of note, if replace ontouchstart onmousedown :active psuedo class works. how work ontouchstart?

edit

basically, preventdefault on ontouchstart stops event cascading otherwise trigger onmousedown event activates :active psuedo-class. question boils down to, why :active psuedo class not work ontouchstart?


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -