焦点位于带占位符的文本框中时,IE11中的下拉宽度会增加 [英] dropdown width increases in IE11 when focus is in textbox with a placeholder

查看:145
本文介绍了焦点位于带占位符的文本框中时,IE11中的下拉宽度会增加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当焦点在< input> 时,我点击< select> 下拉菜单,然后下拉宽度增加。
我试图将焦点的宽度设置为100%,但这不起作用。

When the focus is in the <input> and I click on the <select> dropdown then the dropdown's width is increased. I tried to set the width on focus to 100%, but that's not working.

这是我的html:

<html>
<body>
  <select>
    <option value="volvo">Volvo</option>
    <option value="saab">Saab</option>
    <option value="opel">Opel</option>
    <option value="audi">Audi</option>
  </select>
  <input type="text" placeholder="hello" />
</body>
</html>

p>

推荐答案

添加onmousedown属性并使其专注于选择下拉列表,使其从输入框中失去焦点。

Add the onmousedown attribute and have it focus on the select dropdown so that it loses focus from the input box. For some reason focus on the input before accessing that select causes this error.

< select onmousedown =$(this).focus() >

这篇关于焦点位于带占位符的文本框中时,IE11中的下拉宽度会增加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆