html - submit button 'depressed' state on focus -- potential chrome bug? -


what's submit buttons in chrome?

<input type='text' placeholder='dummy input'/> <input type='submit'/> 

the active 'depressed' state of submit button occur if button does not have focus. reproduce, see this jsfiddle. in fact, text-field isn't necessary, allow tab focus submit button.

so go ahead, place cursor in text field, press tab , click submit while button focused (orange). event fires, button not depress.

pressing spacebar when focused instead of click will depress button. (thx @ineentho) gives?

note: i've submitted this chrome issue tracker

you use javascript/jquery un-focus textbox on hover :active properties applied when clicked.

$("input[type=submit]").hover(function(){      $(this).blur(); }); 

also, apply css :focus pseudoclass, outline invisible.

input[type=submit]:focus {outline:none;} 

see fiddle: http://jsfiddle.net/qahcj/1/

update

i think can't solve without javascript hack, here simpler way it. use piece of code:

$("input[type=submit]").bind("mousedown",function(e){     return false; }); 

demo: http://jsfiddle.net/gfmtt/


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -