0

当我在 PrimeNg (7.x) p-tree 上添加过滤器属性时,它按预期工作,但我有一个双滚动条。

实现并不特别

            <div class="row" *ngIf="formControls.wantThemes.value">
                <div class="col-4 app-notif-edit-label"></div>
                <div class="col-4 app-notif-edit-content">
                    <h4>Themes</h4>
                    <p-tree
                        [filter]="true"
                        class="app-notif-p-tree"
                        [value]="cmtyThemesTreeNodes"
                        [(selection)]="selectedCmtyThemesTreeNodes"
                        selectionMode="checkbox"
                        (onNodeSelect)="nodeSelectThemes($event)"
                        (onNodeUnselect)="nodeSelectThemes($event)"
                    >
                    </p-tree>
                </div>
            </div>

我已应用以下 css 来限制框的大小

.app-notif-p-tree .ui-tree {
color: $sinapseBlue;
display: block;
font-size: medium;
height: 100%;
margin: 2% auto;
max-height: 250px;
min-height: 250px;
overflow: auto;
white-space: nowrap;
width: 97%; }

双卷轴

如果我将溢出更改为隐藏,我看不到列表的最后一个元素。

在此处输入图像描述

知道为什么吗?谢谢

4

1 回答 1

0

我添加了 .app-notif-p-tree .ui-tree .ui-tree-container { height: 80%; }

于 2021-02-05T08:30:47.500 回答