Visitar URL original
USWDS - Select: Multiple select overflow by mahoneycm · Pull Request #5268 · uswds/uswds · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/usa-select/src/styles/_usa-select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
&[multiple] {
height: auto;
background-image: none;
padding-right: 0;
}

option {
overflow: hidden;
text-overflow: ellipsis;
}

&:disabled,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<form class="usa-form">
<label class="usa-label" for="options">Dropdown label</label>
<select class="usa-select" name="options" id="options" multiple size="{{ size }}" >
<option value>- Select -</option>
<option value="value1">Option A</option>
<option value="value2">Option B</option>
<option value="value3">Option C - A longer text option than the select box</option>
<option value="value1">Option E</option>
<option value="value2">Option F</option>
<option value="value3">Option G</option>
</select>
</form>
4 changes: 3 additions & 1 deletion packages/usa-select/src/usa-select.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Component from "./usa-select.twig";
import MultipleTest from "./test/test-patterns/usa-select--multiple.twig";

export default {
title: "Components/Form Inputs/Select",
Expand All @@ -12,6 +13,7 @@ export default {
};

const Template = (args) => Component(args);
const MultipleTemplate = (args) => MultipleTest(args);

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

Expand All @@ -25,7 +27,7 @@ AriaDisabled.args = {
disabled_state: "aria-disabled",
};

export const Multiple = Template.bind({});
export const Multiple = MultipleTemplate.bind({});
Multiple.args = {
multiple: true,
size: 0,
Expand Down