Skip to content

Commit 2141517

Browse files
authored
Merge pull request #2473 from hashicorp/alex-ju/fix-power-select-placeholder
`SuperSelect::Multiple` - fix placeholder style and layout
2 parents 6387ff6 + 588363c commit 2141517

File tree

3 files changed

+28
-9
lines changed

3 files changed

+28
-9
lines changed

.changeset/nice-llamas-tap.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hashicorp/design-system-components": patch
3+
---
4+
5+
`SuperSelect::Multiple` - Fixed placeholder style and layout

packages/components/src/styles/components/form/super-select.scss

+5-1
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ $hds-super-select-item-height: 36px;
7272
margin-left: 0;
7373
}
7474

75-
.ember-power-select-placeholder {
75+
.ember-power-select-placeholder {
7676
color: var(--token-form-control-base-foreground-placeholder-color);
77+
font-size: var(--token-typography-body-200-font-size);
78+
font-family: var(--token-typography-body-200-font-family);
79+
line-height: var(--token-typography-body-200-line-height);
7780
}
7881

7982
// `BasicDropdown` uses `aria-disabled` on the trigger, see: https://ember-basic-dropdown.com/docs/disabled
@@ -272,6 +275,7 @@ $hds-super-select-item-height: 36px;
272275
// Tag List
273276
.ember-power-select-multiple-options {
274277
display: flex;
278+
flex-grow: 1;
275279
flex-wrap: wrap;
276280
gap: 4px;
277281
min-width: 0;

showcase/app/templates/components/form/super-select.hbs

+18-8
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,10 @@
521521

522522
<Shw::Text::H2>Form::SuperSelect::Multiple::Base</Shw::Text::H2>
523523

524-
<Shw::Text::H3>Interaction</Shw::Text::H3>
524+
<Shw::Text::H3>Interaction status</Shw::Text::H3>
525525

526-
<Shw::Flex @direction="row" as |SF|>
527-
<SF.Item {{style flex="1"}} @label="Default">
526+
<Shw::Grid @columns={{3}} as |SG|>
527+
<SG.Item @label="Default">
528528
<Hds::Form::SuperSelect::Multiple::Base
529529
@onChange={{this.noop}}
530530
@options={{@model.OPTIONS}}
@@ -533,9 +533,19 @@
533533
>
534534
{{option}}
535535
</Hds::Form::SuperSelect::Multiple::Base>
536-
</SF.Item>
537-
538-
<SF.Item {{style flex="1"}} @label="Selected">
536+
</SG.Item>
537+
<SG.Item @label="With placeholder">
538+
<Hds::Form::SuperSelect::Multiple::Base
539+
@onChange={{fn (mut @model.SELECTED_OPTIONS)}}
540+
@options={{@model.OPTIONS}}
541+
@placeholder="Placeholder text for multiple selection"
542+
@ariaLabel="Label"
543+
as |option|
544+
>
545+
{{option}}
546+
</Hds::Form::SuperSelect::Multiple::Base>
547+
</SG.Item>
548+
<SG.Item @label="Selected">
539549
<Hds::Form::SuperSelect::Multiple::Base
540550
@onChange={{fn (mut @model.SELECTED_OPTIONS)}}
541551
@options={{@model.OPTIONS}}
@@ -545,8 +555,8 @@
545555
>
546556
{{option}}
547557
</Hds::Form::SuperSelect::Multiple::Base>
548-
</SF.Item>
549-
</Shw::Flex>
558+
</SG.Item>
559+
</Shw::Grid>
550560

551561
<Shw::Divider @level="2" />
552562

0 commit comments

Comments
 (0)