在选择项目时,ScrollBar不会使用箭头键向下移动

时间:2019-07-11 06:31:29

标签: html css scroll

我想在使用键盘键选择项目时上下滚动滚动条。

<div
     style="width: 100%; overflow-y:auto; max-height: 270px;;" 
     class="suggestion-items">
  <div
       style="width:100%;"        
       class="suggestion-item">
    {{items}}
  </div>
</div>

某些CSS如下

.suggestion-items {
    border: 1px solid;
    border-color: @typeahead-item-border;
    color: @typeahead-item-color;
    background-color: @typeahead-item-bg;
    position: absolute;
    top: 32px;
    z-index: @zindex-typeahead; 
    width: 100%;
}

在这里,我可以使用键盘选择结果项,但是在选择隐藏在容器内的项目时,滚动条不会移动。由于我给了溢出-y:auto;与max-height:270px;这样滚动条就会出现。

0 个答案:

没有答案