Skip to content

Commit d5a7fb0

Browse files
authored
Merge pull request #5268 from uswds/cm-multiple-select-overflow
USWDS - Select: Multiple select overflow
2 parents b4e961f + 651a154 commit d5a7fb0

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

packages/usa-select/src/styles/_usa-select.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
&[multiple] {
2929
height: auto;
3030
background-image: none;
31+
padding-right: 0;
32+
}
33+
34+
option {
35+
overflow: hidden;
36+
text-overflow: ellipsis;
3137
}
3238

3339
&:disabled,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<form class="usa-form">
2+
<label class="usa-label" for="options">Dropdown label</label>
3+
<select class="usa-select" name="options" id="options" multiple size="{{ size }}" >
4+
<option value>- Select -</option>
5+
<option value="value1">Option A</option>
6+
<option value="value2">Option B</option>
7+
<option value="value3">Option C - A longer text option than the select box</option>
8+
<option value="value1">Option E</option>
9+
<option value="value2">Option F</option>
10+
<option value="value3">Option G</option>
11+
</select>
12+
</form>

packages/usa-select/src/usa-select.stories.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Component from "./usa-select.twig";
2+
import MultipleTest from "./test/test-patterns/usa-select--multiple.twig";
23

34
export default {
45
title: "Components/Form Inputs/Select",
@@ -12,6 +13,7 @@ export default {
1213
};
1314

1415
const Template = (args) => Component(args);
16+
const MultipleTemplate = (args) => MultipleTest(args);
1517

1618
export const Select = Template.bind({});
1719

@@ -25,7 +27,7 @@ AriaDisabled.args = {
2527
disabled_state: "aria-disabled",
2628
};
2729

28-
export const Multiple = Template.bind({});
30+
export const Multiple = MultipleTemplate.bind({});
2931
Multiple.args = {
3032
multiple: true,
3133
size: 0,

0 commit comments

Comments
 (0)