当我转到最后一行(第25号)并单击编辑时,您将看到下拉列表中它被裁剪掉了。你能想出如何解决这个问题吗?

https://plnkr.co/edit/22e9bo?p=preview
<div ui-scroll-viewport class="col-md-12" style="height: 500px; border: dashed 1px #ddd;">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>id</th>
<th>source</th>
<th>destination</th>
</tr>
</thead>
<tbody>
<tr ui-scroll="item in datasource">
<td>{{item.id}} <a ng-click="showDropdown(item.id)">edit</a></td>
<td>{{item.source}}</td>
<td ng-if="dropdowns.active !== item.id">{{item.destination}}</td>
<td ng-if="dropdowns.active === item.id">
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
{{item.destination}}
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a href="#">10.0.0.0</a></li>
<li><a href="#">10.255.255.255</a></li>
<li><a href="#">172.16.0.0</a></li>
<li><a href="#">172.31.255.255</a></li>
<li><a href="#">192.168.255.255</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">192.168.0.0</a></li>
</ul>
</div>
</td>
</tr>
</tbody>
</table>
</div>发布于 2017-12-12 05:50:39
一般来说,这不是ui滚动的问题,这是Bootstrap在DOM中托管下拉菜单的方式。如果hoster元素有overflow-y: scroll,那么您将得到问题中描述的情况。作为一个angular-way解决方案,我建议对Bootstrap使用angular-ui包装:https://angular-ui.github.io/bootstrap/。
他们有Dropdown directive,它有dropdown-append-to和dropdown-append-to-body设置,允许你将你的Bootstrap下拉菜单附加到任何元素上。这将解决问题。
https://stackoverflow.com/questions/42786435
复制相似问题