剑道下拉列表弹出高度不起作用

时间:2019-05-06 15:56:25

标签: angular kendo-ui kendo-ui-angular2

在此StackBlitz中,我有一个Kendo for Angular下拉列表,其弹出高度设置为20px。不过,当我打开下拉列表时,弹出高度保持不变。如何进行这项工作?

@Component({
selector: 'my-app',
template: `
 <kendo-dropdownlist [data]="listItems" [popupSettings]="{ height: 20 }">
 </kendo-dropdownlist>
`
})
export class AppComponent {
  public listItems: Array<string> = ["Item 1", "Item 2", "Item 3", "Item 4"];
}

1 个答案:

答案 0 :(得分:1)

更好的方法是使用popupClass而不是height。这使您可以定义为弹出窗口执行的css类。在该类中,您可以定义诸如min-height等的属性。

[popupSettings]="{ popupClass: 'myPopupClass' }"

See documentation

修改

在上述解决方案中,您似乎必须设置ViewEncapsulation.None并在CSS中设置height属性。

我找到了一个更简单的解决方案:

看起来您还必须设置'listHeight'。默认情况下,listHeight为200px。

看看这个Stackblitz

<kendo-dropdownlist [data]="listItems" [popupSettings]="{ height: 20 }" listHeight="20">
</kendo-dropdownlist>
相关问题