[英]HTML select box is displaying below windows task bar in chrome
I am trying to add an html dropdown using the select tag and unfortunately in chrome I am unable to select option 5 and 6 as they are being displayed below the task bar in chrome on windows. 我正在尝试使用select标签添加html下拉列表,不幸的是在chrome中我无法选择选项5和6,因为它们显示在Windows上的chrome任务栏下方。 If I add an option 7 then suddenly the list displays above instead of below.
如果我添加选项7然后突然显示上面而不是下面的列表。
This list will always be changing sizes so unfortunately positioning the list higher will not be an option as there is always the possibility of 2 options being hidden. 此列表将始终更改大小,因此不幸的是,将列表放在更高位置将不是一个选项,因为总有可能隐藏2个选项。 Furthermore, the number of items displayed in the list is before a scroll bar is added is browser specific.
此外,列表中显示的项目数是在添加滚动条之前是浏览器特定的。 See Height of an HTML select box (dropdown)
查看HTML选择框的高度(下拉列表)
What I've tried so far: 到目前为止我尝试过的:
I would rather not add in any external libraries and find some kind of simple Jquery hack to fix this. 我宁愿不添加任何外部库,并找到一些简单的Jquery黑客来解决这个问题。 You can also see what I mean by visiting this jsfiddle link and dragging the display window to the bottom of the screen:
您还可以通过访问此jsfiddle链接并将显示窗口拖动到屏幕底部来查看我的意思:
<div class="form-group">
<label for="sel1">Select list:</label>
<select class="form-control" id="sel1">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
</select>
</div>
https://jsfiddle.net/v9t4rm16/ https://jsfiddle.net/v9t4rm16/
Looks like this is an official chrome bug It affects Chrome Version 30-61 看起来这是一个官方的Chrome错误它会影响Chrome版本30-61
I do not think there is an official work around. 我认为没有正式的工作。
If you do not want to wait for the chrome fix, then you could try: 如果您不想等待Chrome修复,那么您可以尝试:
对于表单组和表单控件类,将z-index设置为1000
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.