Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE10 removes padding on input with right alignment

I've come across some IE10 wierdness regarding padding in a right aligned inputfield.

Check this fiddle http://jsfiddle.net/fhWhn/

::-ms-clear, ::-ms-clear{
    display: none;
}

This removes the "IE10 icons" but what do I do if I want to keep these and keep my padding? Is there another, smarter, way of keeping the padding after onblur?

like image 347
Strange Klitgaard Avatar asked Dec 07 '12 12:12

Strange Klitgaard


2 Answers

I ran in to this same problem. To get padding back, just set the value of the textbox on blur.

My simple solution:

$("input[type='text']").blur(function (evt){
    var $element = $(this);
    $element.val($element.val());
});
like image 170
Eric Avatar answered Nov 11 '22 09:11

Eric


A possible workaround is to use the style direction: rtl; on your input, which will move the × to the left-hand side of the element. However, the behavior of using right-to-left may not be ideal for your case.

like image 22
JustinStolle Avatar answered Nov 11 '22 09:11

JustinStolle