Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
added maxHeight prop to support scrollable popover for Select faux (#371
Browse files Browse the repository at this point in the history
)

* added maxHeight prop to support scrollable popover for Select faux
component

* removed log

* chore(baseline): update lost-pixel baselines (#372)

Co-authored-by: juliewongbandue <[email protected]>

---------

Co-authored-by: devex-bot-github <[email protected]>
Co-authored-by: juliewongbandue <[email protected]>
  • Loading branch information
3 people authored Nov 16, 2023
1 parent cba7ed8 commit d0602e1
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 1 deletion.
Binary file modified lost-pixel/baseline/components-avatar--size.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed lost-pixel/baseline/labs-pronouns--auto-complete.png
Binary file not shown.
Binary file removed lost-pixel/baseline/labs-pronouns--comments.png
Binary file not shown.
Binary file not shown.
Binary file removed lost-pixel/baseline/labs-pronouns--user-settings.png
Binary file not shown.
Binary file removed lost-pixel/baseline/labs-pronouns--video-list.png
Binary file not shown.
Binary file removed lost-pixel/baseline/labs-themekit--common.png
Binary file not shown.
29 changes: 29 additions & 0 deletions src/components/inputs/Select/Select.props.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,35 @@ export function FauxExternalState({ args }) {
}
FauxExternalState.storyName = 'faux (external state)';

export function FauxMaxHeight({ args }) {
const [value, valueSet] = useState(null);

function onChange(event) {
valueSet(event.target.value);
}

return (
<Layout.StoryVertical>
<Select
{...args}
label="Faux select with maximum height"
onChange={onChange}
placeholder="Please select an option."
value={value}
faux
maxHeight="300px"
>
{Array.from({ length: 20 }, (_, index) => (
<Select.Option key={index} value={index}>{`Option ${
index + 1
}`}</Select.Option>
))}
</Select>
</Layout.StoryVertical>
);
}
FauxMaxHeight.storyName = 'faux (maximum height)';

const UpgradeBadge = (
<Badge
// @ts-ignore
Expand Down
4 changes: 4 additions & 0 deletions src/components/inputs/Select/Select.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export type Props = IrisInputProps<
*/
size?: Sizes;
value?: string | string[];
/**
* [default = '100%']
*/
maxHeight?: string;
},
HTMLSelectElement
>;
Expand Down
8 changes: 7 additions & 1 deletion src/components/inputs/Select/SelectFaux.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export function SelectFaux({
size = 'md',
status,
style,
maxHeight = '100%',
value,
...props
}: Props) {
Expand Down Expand Up @@ -113,7 +114,12 @@ export function SelectFaux({
>
<PopOver
attach="bottom"
style={{ width, maxWidth: '100%' }}
style={{
width,
maxWidth: '100%',
maxHeight,
overflowY: 'scroll',
}}
content={<div ref={popOverRef}>{content}</div>}
active={disabled ? false : active}
>
Expand Down

0 comments on commit d0602e1

Please sign in to comment.