Skip to content

Commit

Permalink
fix(Select): fix overflow in select field
Browse files Browse the repository at this point in the history
  • Loading branch information
Lisa18289 committed Oct 14, 2024
1 parent 3dda8b0 commit c571018
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 c571018

Please sign in to comment.