3 ms·
Check the css for `:active` as the button is being styled for `:active` which doesn't care if the Javascript functionality takes place or not. If you debounce t
by Nadya 9y ago
Check the css for `:active` as the button is being styled for `:active` which doesn't care if the Javascript functionality takes place or not. If you debounce the Javascript to prevent the action from firing multiple times that doesn't stop you from clicking the button and setting it to the `:active` state causing the styles to occur.
Codepen example: https://codepen.io/anon/pen/bvGrKY https://codepen.io/anon/pen/bvGrKY
Click the button as much as you like - after 200 milliseconds you'll get a single alert but the `:active` style always applies on click.