Skip to content

Commit e1c8850

Browse files
authored
fix(combobox): Fix spacing/alignment on select-only combobox without placeholder (#4989)
* add psuedo element to select-only combobox placeholder to maintain spacing/alignment * fix CirceCI publish-site job
1 parent f971207 commit e1c8850

File tree

7 files changed

+68
-35
lines changed

7 files changed

+68
-35
lines changed

.circleci/config.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -485,18 +485,18 @@ jobs:
485485
- node/install-npm
486486
- node/install-packages
487487

488-
- run:
489-
name: 'Build static site'
490-
command: 'npm run build'
491-
environment:
492-
SLDS__FRAMEWORK__PATH: .slds/.dist/
493-
494488
# Heroku
495489
- heroku/install
496490
- run:
497491
name: 'Install Heroku Build CLI plugin'
498492
command: 'heroku plugins:install heroku-builds'
499493

494+
- run:
495+
name: 'Build static site'
496+
command: 'npm run build'
497+
environment:
498+
SLDS__FRAMEWORK__PATH: .slds/.dist/
499+
500500
- run:
501501
name: 'Generate site tarball'
502502
command: |

RELEASENOTES.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
<!-- Release notes authoring guidelines: http://keepachangelog.com/ -->
22
<!-- !!! THIS FILE IS AUTO-GENERATED !!! DO NOT EDIT THIS FILE MANUALLY !!! -->
33

4-
## Release 2.17.3 - January 25, 2022
4+
## Release 2.17.3 - January 26, 2022
55

66
## Components
77
### [Checkbox](https://www.lightningdesignsystem.com/components/checkbox)
88
#### Fixed
99
- Checkbox inputs will no longer collapse horizontally when a label with a large amount of text is used.
1010

11+
### [Combobox](https://www.lightningdesignsystem.com/components/combobox)
12+
## Fixed
13+
- Fixed spacing/alignment issue in `.slds-input_faux > span` for select-only combobox without a placeholder.
14+
1115
## Release 2.17.2 - January 20, 2022
1216

1317
## Components

ui/components/combobox/RELEASENOTES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
<!-- ## [Unreleased] -->
66

7+
## 2.17.3
8+
9+
## Fixed
10+
11+
- Fixed spacing/alignment issue in `.slds-input_faux > span` for select-only combobox without a placeholder.
12+
713
## 2.16.2
814

915
## Removed

ui/components/combobox/base/example.jsx

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
import { ListboxPills, ListboxPillsItem, ListboxPill } from '../../pills';
1515
import { UtilityIcon } from '../../icons/base/example';
1616
import { StandardIcon } from '../../icons/standard/example';
17+
import Grid, { Column } from '../../../utilities/grid/docs/Grid';
1718
import _ from '../../../shared/helpers';
1819
import * as Snapshot from '../snapshots.data';
1920

@@ -52,6 +53,36 @@ export const ListboxDropdown = props => (
5253
</DeprecatedListbox>
5354
);
5455

56+
const ComboBoxDefault = props => (
57+
<Combobox
58+
id={_.uniqueId('combobox-id-')}
59+
aria-controls="listbox-id-1"
60+
inputIconPosition="right"
61+
rightInputIcon={
62+
<UtilityIcon
63+
symbol="down"
64+
className="slds-icon slds-icon_x-small slds-icon-text-default"
65+
containerClassName="slds-input__icon slds-input__icon_right"
66+
assistiveText={false}
67+
title={false}
68+
/>
69+
}
70+
results={
71+
<Listbox
72+
id="listbox-id-1"
73+
snapshot={Snapshot.ObjectOptions}
74+
type="plain"
75+
count={8}
76+
visualSelection
77+
/>
78+
}
79+
resultsType="listbox"
80+
hasInteractions
81+
selectOnly
82+
{...props}
83+
/>
84+
)
85+
5586
/* -----------------------------------------------------------------------------
5687
Exports
5788
----------------------------------------------------------------------------- */
@@ -63,32 +94,7 @@ export default [
6394
id: `${STORY_SINK_CONTEXT.toLowerCase()}-default`,
6495
label: `${STORY_SINK_CONTEXT} default (select-only)`,
6596
element: (
66-
<Combobox
67-
id={_.uniqueId('combobox-id-')}
68-
aria-controls="listbox-id-1"
69-
inputIconPosition="right"
70-
rightInputIcon={
71-
<UtilityIcon
72-
symbol="down"
73-
className="slds-icon slds-icon_x-small slds-icon-text-default"
74-
containerClassName="slds-input__icon slds-input__icon_right"
75-
assistiveText={false}
76-
title={false}
77-
/>
78-
}
79-
results={
80-
<Listbox
81-
id="listbox-id-1"
82-
snapshot={Snapshot.ObjectOptions}
83-
type="plain"
84-
count={8}
85-
visualSelection
86-
/>
87-
}
88-
resultsType="listbox"
89-
hasInteractions
90-
selectOnly
91-
/>
97+
<ComboBoxDefault />
9298
)
9399
}
94100
];
@@ -539,5 +545,17 @@ export let states = [
539545
</DeprecatedCombobox>
540546
</div>
541547
)
548+
},
549+
{
550+
context: STORY_SINK_CONTEXT,
551+
id: `${STORY_SINK_CONTEXT.toLowerCase()}-without-placeholder`,
552+
label: `${STORY_SINK_CONTEXT} without placeholder (select-only)`,
553+
element: (
554+
<Grid className="slds-gutters">
555+
<Column><ComboBoxDefault placeholder="This has a placeholder…"/></Column>
556+
<Column><ComboBoxDefault placeholder=""/></Column>
557+
<Column><ComboBoxDefault placeholder="…the middle one does not"/></Column>
558+
</Grid>
559+
)
542560
}
543561
];

ui/components/combobox/deprecated/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const DeprecatedObjectSwitcher = props => {
5454

5555
/**
5656
* Combobox input element. This is deprecated since updated a11y guidance is to
57-
* have select-only comboboxes replace the input with a div
57+
* have select-only comboboxes replace the input with a button
5858
* @name DeprecatedComboboxInputElement
5959
* @prop {boolean} aria-activedescendant
6060
* @prop {string} aria-controls

ui/components/combobox/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ const ComboboxInput = ({
149149
}) => {
150150
const hasInputIcon = leftInputIcon || rightInputIcon || showCloseButton;
151151
const { isOpen } = useContext(ComboboxFormContext);
152-
const placeholderValue = !placeholder
152+
const placeholderValue = !placeholder && placeholder !== ""
153153
? autocomplete
154154
? 'Search...'
155155
: 'Select an Option…'

ui/components/input/base/_index.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@
127127
&.slds-is-disabled {
128128
@include input-disabled;
129129
}
130+
131+
> span:before {
132+
content: '';
133+
display: inline-block;
134+
}
130135
}
131136

132137
/**

0 commit comments

Comments
 (0)