Skip to content

Commit

Permalink
Refactor #4052
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Feb 14, 2023
1 parent 9b86166 commit 91bc90f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/lib/cascadeselect/CascadeSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ export const CascadeSelect = React.memo(
const selector = `${attributeSelectorState}_panel`;
const innerHTML = `
@media screen and (max-width: ${props.breakpoint}) {
.p-cascadeselect-panel[${selector}] .p-cascadeselect-items-wrapper > ul {
max-height: ${props.scrollHeight};
overflow: ${props.scrollHeight ? 'auto' : ''};
}
.p-cascadeselect-panel[${selector}] .p-cascadeselect-sublist {
position: relative;
}
Expand Down
1 change: 1 addition & 0 deletions components/lib/cascadeselect/CascadeSelectBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const CascadeSelectBase = {
appendTo: null,
transitionOptions: null,
dropdownIcon: 'pi pi-chevron-down',
scrollHeight: '400px',
onChange: null,
onGroupChange: null,
onBeforeShow: null,
Expand Down
5 changes: 5 additions & 0 deletions components/lib/cascadeselect/cascadeselect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ export interface CascadeSelectProps extends Omit<React.DetailedHTMLProps<React.I
* @defaultValue pi pi-chevron-down
*/
dropdownIcon?: string | undefined;
/**
* Maximum height of the options panel on responsive mode.
* @defaultValue 400px
*/
scrollHeight?: string | undefined;
/**
* Callback to invoke on value change
* @param {CascadeSelectChangeEvent} event - Custom change event
Expand Down

0 comments on commit 91bc90f

Please sign in to comment.