Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(combobox): associate label with button #725

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
56 changes: 28 additions & 28 deletions ui/components/combobox/__tests__/__snapshots__/index.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ exports[`Combobox with a Dialog dropdown renders a closed, readonly dialog combo
aria-controls="popover-id-01"
aria-expanded="false"
aria-haspopup="dialog"
aria-labelledby="combobox-label-id-19 combobox-id-01-selected-value"
aria-labelledby="combobox-label-id-19 combobox-id-01"
className="slds-input_faux slds-combobox__input"
id="combobox-id-01-selected-value"
id="combobox-id-01"
onBlur={[Function]}
onFocus={[Function]}
type="button"
Expand Down Expand Up @@ -126,9 +126,9 @@ exports[`Combobox with a Dialog dropdown renders an open, readonly dialog combob
aria-controls="popover-id-01"
aria-expanded="true"
aria-haspopup="dialog"
aria-labelledby="combobox-label-id-20 combobox-id-01-selected-value"
aria-labelledby="combobox-label-id-20 combobox-id-01"
className="slds-input_faux slds-combobox__input"
id="combobox-id-01-selected-value"
id="combobox-id-01"
onBlur={[Function]}
onFocus={[Function]}
type="button"
Expand Down Expand Up @@ -1428,9 +1428,9 @@ exports[`render combobox render autocomplete entity combobox with single selecti
aria-controls="listbox-id-01"
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="combobox-label-id-13 combobox-id-01-selected-value"
aria-labelledby="combobox-label-id-13 combobox-id-01"
className="slds-input_faux slds-combobox__input slds-combobox__input-value"
id="combobox-id-01-selected-value"
id="combobox-id-01"
onBlur={[Function]}
onFocus={[Function]}
type="button"
Expand Down Expand Up @@ -1604,9 +1604,9 @@ exports[`render combobox render base combobox 1`] = `
aria-controls="listbox-id-01"
aria-expanded="true"
aria-haspopup="listbox"
aria-labelledby="combobox-label-id-1 combobox-id-01-selected-value"
aria-labelledby="combobox-label-id-1 combobox-id-01"
className="slds-input_faux slds-combobox__input slds-has-focus slds-combobox__input-value"
id="combobox-id-01-selected-value"
id="combobox-id-01"
onBlur={[Function]}
onFocus={[Function]}
type="button"
Expand Down Expand Up @@ -2084,9 +2084,9 @@ exports[`render combobox render grouped combobox 1`] = `
aria-controls="objectswitcher-listbox-id-01"
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="combobox-label-id-15 combobox-id-01-object-switcher-selected-value"
aria-labelledby="combobox-label-id-15 combobox-id-01-object-switcher"
className="slds-input_faux slds-combobox__input slds-combobox__input-value"
id="combobox-id-01-object-switcher-selected-value"
id="combobox-id-01-object-switcher"
onBlur={[Function]}
onFocus={[Function]}
type="button"
Expand Down Expand Up @@ -2655,9 +2655,9 @@ exports[`render combobox render grouped combobox displaying options based on use
aria-controls="objectswitcher-listbox-id-01"
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="combobox-label-id-16 combobox-id-01-object-switcher-selected-value"
aria-labelledby="combobox-label-id-16 combobox-id-01-object-switcher"
className="slds-input_faux slds-combobox__input slds-combobox__input-value"
id="combobox-id-01-object-switcher-selected-value"
id="combobox-id-01-object-switcher"
onBlur={[Function]}
onFocus={[Function]}
type="button"
Expand Down Expand Up @@ -3242,9 +3242,9 @@ exports[`render combobox render grouped combobox with selections made in collaps
aria-controls="objectswitcher-listbox-id-01"
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="combobox-label-id-17 combobox-id-01-object-switcher-selected-value"
aria-labelledby="combobox-label-id-17 combobox-id-01-object-switcher"
className="slds-input_faux slds-combobox__input slds-combobox__input-value"
id="combobox-id-01-object-switcher-selected-value"
id="combobox-id-01-object-switcher"
onBlur={[Function]}
onFocus={[Function]}
type="button"
Expand Down Expand Up @@ -4220,9 +4220,9 @@ exports[`render combobox render grouped combobox with selections made in expande
aria-controls="objectswitcher-listbox-id-01"
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="combobox-label-id-18 combobox-id-01-object-switcher-selected-value"
aria-labelledby="combobox-label-id-18 combobox-id-01-object-switcher"
className="slds-input_faux slds-combobox__input slds-combobox__input-value"
id="combobox-id-01-object-switcher-selected-value"
id="combobox-id-01-object-switcher"
onBlur={[Function]}
onFocus={[Function]}
type="button"
Expand Down Expand Up @@ -5146,7 +5146,7 @@ exports[`render combobox render multiple selections in a closed combobox 1`] = `
>
<label
className="slds-form-element__label"
htmlFor="combobox-id-8"
htmlFor="combobox-id-7"
id="combobox-label-id-3"
>
Relate To
Expand All @@ -5168,9 +5168,9 @@ exports[`render combobox render multiple selections in a closed combobox 1`] = `
aria-controls="listbox-id-8"
aria-expanded="false"
aria-haspopup="listbox"
aria-labelledby="combobox-label-id-3 combobox-id-8-selected-value"
aria-labelledby="combobox-label-id-3 combobox-id-7"
className="slds-input_faux slds-combobox__input slds-combobox__input-value"
id="combobox-id-8-selected-value"
id="combobox-id-7"
onBlur={[Function]}
onFocus={[Function]}
type="button"
Expand Down Expand Up @@ -5536,7 +5536,7 @@ exports[`render combobox render single selection in an open combobox 1`] = `
>
<label
className="slds-form-element__label"
htmlFor="combobox-id-5"
htmlFor="combobox-id-4"
id="combobox-label-id-2"
>
Relate To
Expand All @@ -5559,9 +5559,9 @@ exports[`render combobox render single selection in an open combobox 1`] = `
aria-controls="listbox-id-6"
aria-expanded="true"
aria-haspopup="listbox"
aria-labelledby="combobox-label-id-2 combobox-id-5-selected-value"
aria-labelledby="combobox-label-id-2 combobox-id-4"
className="slds-input_faux slds-combobox__input slds-has-focus slds-combobox__input-value"
id="combobox-id-5-selected-value"
id="combobox-id-4"
onBlur={[Function]}
onFocus={[Function]}
type="button"
Expand Down Expand Up @@ -6014,9 +6014,9 @@ exports[`render combobox renders different styles of options in the listbox 1`]
aria-controls="listbox-id-01"
aria-expanded="true"
aria-haspopup="listbox"
aria-labelledby="combobox-label-id-5 combobox-id-01-selected-value"
aria-labelledby="combobox-label-id-5 combobox-id-01"
className="slds-input_faux slds-combobox__input slds-has-focus slds-combobox__input-value"
id="combobox-id-01-selected-value"
id="combobox-id-01"
onBlur={[Function]}
onFocus={[Function]}
type="button"
Expand Down Expand Up @@ -6248,9 +6248,9 @@ exports[`render combobox renders different styles of options in the listbox with
aria-controls="listbox-id-01"
aria-expanded="true"
aria-haspopup="listbox"
aria-labelledby="combobox-label-id-6 combobox-id-01-selected-value"
aria-labelledby="combobox-label-id-6 combobox-id-01"
className="slds-input_faux slds-combobox__input slds-has-focus slds-combobox__input-value"
id="combobox-id-01-selected-value"
id="combobox-id-01"
onBlur={[Function]}
onFocus={[Function]}
type="button"
Expand Down Expand Up @@ -6760,9 +6760,9 @@ exports[`render combobox renders groups in a listbox 1`] = `
aria-controls="listbox-id-01"
aria-expanded="true"
aria-haspopup="listbox"
aria-labelledby="combobox-label-id-4 combobox-id-01-selected-value"
aria-labelledby="combobox-label-id-4 combobox-id-01"
className="slds-input_faux slds-combobox__input slds-has-focus"
id="combobox-id-01-selected-value"
id="combobox-id-01"
onBlur={[Function]}
onFocus={[Function]}
type="button"
Expand Down
2 changes: 1 addition & 1 deletion ui/components/combobox/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const ComboboxInput = ({
{leftInputIcon && leftInputIcon}
{selectOnly ? (
<ComboboxInputFaux
id={`${id}-selected-value`}
id={id}
{...{
hasFocus,
isDisabled,
Expand Down