0

我正在使用SelectBoxIt来设置选择列表的样式。我们有需要滚动的长列表,我按照“长列表”的说明向容器添加了最大高度。但是,当您单击下拉列表时,列表从底部而不是顶部开始?

单击选择时如何强制列表从顶部开始?

这是该网站的链接https://preto.wpengine.com

如果您向下滚动页面以预订餐桌并单击位置或否。的人选择你会看到他们打开并从底部开始,向上滚动列表而不是向下滚动。

4

1 回答 1

0

The problem is that your select options fields are opening above the select fields naturally because they have room to go that way. SelectBoxIt must be using this to generate the direction of the elements. If you open the console and click on <section id="book-a-table"></section> and drag the node up the page (above header) you will be able to see it working correctly. This is because the options now have room to open downwards.

Unfortunately, from what I've read there is no good way to force the direction a select field opens in that works in all browsers as you can see here.

So what I might recommend is trying a bit of a workaround. Try adding a large height to the parent of the select fields like g-form-wrapper. Big enough to allow them to drop down. And then add a smaller height to the parent of that element book-a-table and set it's overflow to hidden to compensate.

Hope it helps!

于 2017-11-24T13:23:39.690 回答