Skip to content

Commit

Permalink
Merge pull request #845 from mittwald/fix-select-overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
TimAufdemKampe authored Oct 28, 2024
2 parents 8bd3f6c + c571018 commit 2d4a9ba
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/components/src/components/Select/Select.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,10 @@
background-color: var(--form-control--background-color--invalid);
}
}

:global(.react-aria-SelectValue) {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Select, { Option } from "../index";
import React from "react";
import { Label } from "@/components/Label";
import defaultMeta from "./Default.stories";
import { dummyText } from "@/lib/dev/dummyText";

const meta: Meta<typeof Select> = {
...defaultMeta,
Expand All @@ -12,7 +13,7 @@ export default meta;

type Story = StoryObj<typeof Select>;

export const Default: Story = {
export const ManyOptions: Story = {
render: (props) => (
<Select {...props}>
<Label>Label</Label>
Expand All @@ -24,3 +25,18 @@ export const Default: Story = {
</Select>
),
};

export const LongTexts: Story = {
render: (props) => (
<Select {...props}>
<Label>Label</Label>
{Array(4)
.fill("")
.map((value, index) => (
<Option key={index}>
Option {index + 1} {dummyText.medium}
</Option>
))}
</Select>
),
};

0 comments on commit 2d4a9ba

Please sign in to comment.