mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Refactor #5437 - For scrollHeight
This commit is contained in:
parent
cb6c2fffef
commit
0b5ac272ef
17 changed files with 41 additions and 11 deletions
|
@ -14,6 +14,10 @@ export default {
|
|||
optionGroupLabel: null,
|
||||
optionGroupChildren: null,
|
||||
listStyle: null,
|
||||
scrollHeight: {
|
||||
type: String,
|
||||
default: '14rem'
|
||||
},
|
||||
invalid: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
|
|
5
components/lib/listbox/Listbox.d.ts
vendored
5
components/lib/listbox/Listbox.d.ts
vendored
|
@ -271,6 +271,11 @@ export interface ListboxProps {
|
|||
* Inline style of inner list element.
|
||||
*/
|
||||
listStyle?: string | undefined;
|
||||
/**
|
||||
* Height of the viewport, a scrollbar is defined if height of list exceeds this value.
|
||||
* @defaultValue 14rem
|
||||
*/
|
||||
scrollHeight?: string | undefined;
|
||||
/**
|
||||
* When present, it specifies that the component should have invalid state style.
|
||||
* @defaultValue false
|
||||
|
|
|
@ -43,8 +43,8 @@
|
|||
{{ filterResultMessageText }}
|
||||
</span>
|
||||
</div>
|
||||
<div ref="listWrapper" :class="cx('wrapper')" :style="listStyle" v-bind="ptm('wrapper')">
|
||||
<VirtualScroller :ref="virtualScrollerRef" v-bind="virtualScrollerOptions" :style="listStyle" :items="visibleOptions" :tabindex="-1" :disabled="virtualScrollerDisabled" :pt="ptm('virtualScroller')">
|
||||
<div :class="cx('wrapper')" :style="[{ 'max-height': virtualScrollerDisabled ? scrollHeight : '' }, listStyle]" v-bind="ptm('wrapper')">
|
||||
<VirtualScroller :ref="virtualScrollerRef" v-bind="virtualScrollerOptions" :items="visibleOptions" :style="[{ height: scrollHeight }, listStyle]" :tabindex="-1" :disabled="virtualScrollerDisabled" :pt="ptm('virtualScroller')">
|
||||
<template v-slot:content="{ styleClass, contentRef, items, getItemOptions, contentStyle, itemSize }">
|
||||
<ul
|
||||
:ref="(el) => listRef(el, contentRef)"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue