Skip to content

Commit ded171b

Browse files
mbauchetMaxime BAUCHETseverinlandolt
authored
fix: allow custom min width for select components (#952)
* fix minWidth --------- Co-authored-by: Maxime BAUCHET <[email protected]> Co-authored-by: severinlandolt <[email protected]>
1 parent e3d1907 commit ded171b

File tree

6 files changed

+24
-15
lines changed

6 files changed

+24
-15
lines changed

src/components/input-elements/MultiSelect/MultiSelect.tsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ const MultiSelect = React.forwardRef<HTMLInputElement, MultiSelectProps>((props,
8181
className={tremorTwMerge(
8282
// common
8383
"w-full min-w-[10rem] relative text-tremor-default",
84+
className,
8485
)}
8586
>
8687
<select
@@ -125,11 +126,6 @@ const MultiSelect = React.forwardRef<HTMLInputElement, MultiSelectProps>((props,
125126
}) as any
126127
}
127128
disabled={disabled}
128-
className={tremorTwMerge(
129-
// common
130-
"w-full min-w-[10rem] relative text-tremor-default",
131-
className,
132-
)}
133129
id={id}
134130
multiple
135131
{...other}

src/components/input-elements/SearchSelect/SearchSelect.tsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ const SearchSelect = React.forwardRef<HTMLInputElement, SearchSelectProps>((prop
8282
className={tremorTwMerge(
8383
// common
8484
"w-full min-w-[10rem] relative text-tremor-default",
85+
className,
8586
)}
8687
>
8788
<select
@@ -125,11 +126,6 @@ const SearchSelect = React.forwardRef<HTMLInputElement, SearchSelectProps>((prop
125126
}) as any
126127
}
127128
disabled={disabled}
128-
className={tremorTwMerge(
129-
// common
130-
"w-full min-w-[10rem] relative text-tremor-default",
131-
className,
132-
)}
133129
id={id}
134130
{...other}
135131
>

src/components/input-elements/Select/Select.tsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const Select = React.forwardRef<HTMLInputElement, SelectProps>((props, ref) => {
6464
className={tremorTwMerge(
6565
// common
6666
"w-full min-w-[10rem] relative text-tremor-default",
67+
className,
6768
)}
6869
>
6970
<select
@@ -107,11 +108,6 @@ const Select = React.forwardRef<HTMLInputElement, SelectProps>((props, ref) => {
107108
}) as any
108109
}
109110
disabled={disabled}
110-
className={tremorTwMerge(
111-
// common
112-
"w-full min-w-[10rem] relative text-tremor-default",
113-
className,
114-
)}
115111
id={id}
116112
{...other}
117113
>

src/stories/input-elements/MultiSelect.stories.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,10 @@ export const Form: Story = {
6666
required: true,
6767
},
6868
};
69+
70+
export const WithCustomMinWidth: Story = {
71+
render: SimpleMultiSelect,
72+
args: {
73+
className: "min-w-min w-[95px]",
74+
},
75+
};

src/stories/input-elements/SearchSelect.stories.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,10 @@ export const ServerSideRendering: Story = {
9292
required: true,
9393
},
9494
};
95+
96+
export const WithCustomMinWidth: Story = {
97+
render: SimpleSearchSelect,
98+
args: {
99+
className: "min-w-min w-[95px]",
100+
},
101+
};

src/stories/input-elements/Select.stories.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,10 @@ export const Form: Story = {
8383
required: true,
8484
},
8585
};
86+
87+
export const WithCustomMinWidth: Story = {
88+
render: SimpleSelect,
89+
args: {
90+
className: "min-w-min w-[95px]",
91+
},
92+
};

0 commit comments

Comments
 (0)