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

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -