Skip to content

Commit 0ae06f5

Browse files
jonnybelmontezume
authored andcommitted
fix: truncate select-input placeholder text is long (#955)
1 parent 12737ed commit 0ae06f5

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/components/inputs/select-input/select-input.visualroute.js

+9
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ const DefaultRoute = ({ themes }) => (
5757
placeholder="Select something"
5858
/>
5959
</Spec>
60+
<Spec label="with a long placeholder">
61+
<SelectInput
62+
value={null}
63+
onChange={() => {}}
64+
options={options}
65+
horizontalConstraint="m"
66+
placeholder="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
67+
/>
68+
</Spec>
6069
<Spec label="with error">
6170
<SelectInput
6271
value={null}

src/components/internals/create-select-styles.js

+4
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ const placeholderStyles = (props, theme) => base => {
194194
return {
195195
...base,
196196
color: overwrittenVars[designTokens.placeholderFontColorForInput],
197+
width: '100%',
198+
overflow: 'hidden',
199+
whiteSpace: 'nowrap',
200+
textOverflow: 'ellipsis',
197201
};
198202
};
199203

0 commit comments

Comments
 (0)