开发者

Dojo filteringselect right aligning long text in IE8

开发者 https://www.devze.com 2023-03-29 07:36 出处:网络
I have a FilteringSelect that contains options that are longer than the width of the \'text input\' po开发者_开发问答rtion of the widget.When I select one of these long values in the dropdown menu it

I have a FilteringSelect that contains options that are longer than the width of the 'text input' po开发者_开发问答rtion of the widget. When I select one of these long values in the dropdown menu it left-aligns the text in Chrome (as I'd expect) but in IE8 it right-aligns the text.

I've tried setting text-align:right; in CSS on input.dijitInputInner, but that doesn't appear to help it.

It appears it was an issue back in IE7 as well: http://mail.dojotoolkit.org/pipermail/dojo-interest/2010-January/042668.html

Although I didn't see where anyone had any solution.


That's a bug of IE that's not connected with dojo only: when you have any input with a focus on it, changing it's value to a long one aligns text to the right in IE. I hadn't found any suitable solutions for this.

However, there is one that I use in JQuery (I don't familliar with dojo, so there it is in jQuery: http://jsfiddle.net/kizu/ZFts2/5/)

The point is, only for ie, after the long value inserted, blur() and then focus() again this input. That must be somewhat simple to make in dojo.

The downside is: the caret would move to the start of line, so it's not the perfect solution, but the only I had found.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号