Can I control positioning of IE 10 select boxes?

2019-05-09 00:08发布

In Internet Explorer 10 the behavior of drop-down boxes (<select> element) has changed: when expanding the box, instead of placing the list of options below the field, the list overlays the field, with the list positioned so that the currently-selected element is centered over the input field.

This is a little hard to describe, so here's a jsFiddle that shows it.

Our users are finding this behavior very confusing. Is there anything I can do in CSS to make the box behave like it did in IE9, and like every other major browser? (Perhaps something like the -ms-clear pseudo-element that hides the clear button in IE10 text input fields.)

Here's a sort of time-lapse screenshot:

IE 10 select box behavior screenshot

1条回答
三岁会撩人
2楼-- · 2019-05-09 00:42

One option is dynamically change size property of the select to the number of options (or a fixed number - if you have too many options). You would do it on mouse-down, and change it back on-change.

Style, Position of select as well as additional events will have to be tweaked - but here is the proof of concept: http://jsfiddle.net/KnAXL/1/

查看更多
登录 后发表回答