css - p-列表框 : search filter textbox does not fit to width

标签 css primeng

使用当前版本 8.0.2 的 PrimeNg 我遇到了列表框内搜索框的布局问题。显然这已在 3077 中解决. 我有 created a stackblitz example这样你就可以看到了。

html代码是:

<p-listbox [options]="cities" [(ngModel)]="selectedCities" multiple="multiple" checkbox="checkbox" filter="filter" optionLabel="name"
[listStyle]="{'max-height':'150px', 'width':'300px'}">
  <p-header>
    Cities
  </p-header>
</p-listbox>

错误回来了吗?我错过了什么吗?

感谢您的帮助!

最佳答案

如文档中所示,问题在于混合了属性 [style][listStyle]

  • style - Inline style of the container.
  • styleClass - Style class of the container.
  • listStyle - Inline style of the list element

.

所以内联样式应该分成两个不同的属性:

<p-listbox [options]="cities" [(ngModel)]="selectedCities" multiple="multiple" checkbox="checkbox" filter="filter" optionLabel="name"
[listStyle]="{'max-height':'150px'}" 
[style]="{'width':'300px'}">
  <p-header>
    Cities
  </p-header>
</p-listbox>

关于css - p-列表框 : search filter textbox does not fit to width,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57552986/

相关文章:

angular - p-inputMask ng-model 未清除无效值

javascript - 创建后,jquery 选择上面的元素

javascript - 通过jQuery设置di​​v的行高?

html - 如何在输入文本框的右侧和左侧添加两张图片?

html - 如何使用 CSS 将 <label> 放在 ASP.Net 中的文本框控件上?

angular - 属性 'value' 在primeng 表上的类型 'FilterMetadata' 上不存在

html - 汉堡导航不可点击 - 已检查脚本和 CDN

html - Flex 不会像示例中所示那样进入

angular - 焦点不会停留在 PrimeNG <p-dialog> 组件内

html - 按钮在悬停时不会隐藏