Skip to content

Commit 26694da

Browse files
Kanupriya1511Kanupriya Thakur
andauthored
feat: adds max height and scrollbar to people picker (#3429)
Co-authored-by: Kanupriya Thakur <[email protected]>
1 parent 1b23782 commit 26694da

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

packages/mgt-components/src/components/mgt-people-picker/mgt-people-picker.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ $people-picker-font-size: var(--people-picker-font-size, 14px);
131131
list-style: none;
132132
padding: 4px;
133133
margin: auto;
134+
max-height: var(--people-picker-dropdown-max-height, 300px);
135+
overflow-y: var(--people-picker-dropdown-scrollbar, auto);
134136

135137
&-result {
136138
padding: 4px;

packages/mgt-components/src/components/mgt-people-picker/mgt-people-picker.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ export const registerMgtPeoplePickerComponent = () => {
101101
* @cssprop --people-picker-result-person-avatar-size - {Length} the avatar size of the person in the result. Default is 40px.
102102
* @cssprop --people-picker-selected-person-avatar-size - {Length} the avatar size of the selected person. Default is 24px.
103103
* @cssprop --people-picker-font-size - {Length} the font size of the text in the people picker input. Default is 14px.
104+
* @cssprop --people-picker-dropdown-max-height - {Length} the maximum height of the dropdown. Default is 300px.
105+
* @cssprop --people-picker-dropdown-scrollbar - {String} the scrollbar behavior for the dropdown. Default is auto.
104106
*/
105107
export class MgtPeoplePicker extends MgtTemplatedTaskComponent {
106108
/**

packages/mgt-element/src/utils/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
// THIS FILE IS AUTO GENERATED
99
// ANY CHANGES WILL BE LOST DURING BUILD
1010

11-
export const PACKAGE_VERSION = '4.4.0';
11+
export const PACKAGE_VERSION = '4.5.0';

stories/components/peoplePicker/peoplePicker.style.stories.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export const customCSSProperties = () => html`
2424
--people-picker-dropdown-result-background-color: yellow;
2525
--people-picker-dropdown-result-hover-background-color: gold;
2626
--people-picker-dropdown-result-focus-background-color: green;
27+
--people-picker-dropdown-max-height: 100px;
28+
--people-picker-dropdown-scrollbar: auto;
2729
--people-picker-no-results-text-color: white;
2830
--people-picker-input-background: gray;
2931
--people-picker-input-border-color: yellow;

0 commit comments

Comments
 (0)