-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix SearchWithin aria-label and aria-labelledby #2288
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
Changes from all commits
6a28363
b4dfbb5
aaba4e6
e082842
3e260e1
f1a55ab
d43d47e
29c3781
473dd7f
f3d125d
d114f66
cd42b92
1c065b0
e90e8b9
b92d67a
3d0bc99
5334368
42febf5
db0aec0
38add86
fbdd4a9
36e3154
103a4e6
d24edb7
4371f6b
7ac7085
b79d826
6713f39
d2d6547
7539a64
84842e8
48e8650
2e6fe51
19c16c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "search": "Search", | ||
| "searchWithin": "Search within" | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -26,7 +26,7 @@ export default { | |||||
|
|
||||||
| function render(props: Omit<SpectrumSearchWithinProps, 'children'> = {}, searchFieldProps: SearchFieldProps = {}, pickerProps: Omit<SpectrumPickerProps<object>, 'children'> = {}) { | ||||||
| return ( | ||||||
| <SearchWithin label="Search" {...props}> | ||||||
| <SearchWithin label="This is label" {...props}> | ||||||
| <SearchField placeholder="Search" {...searchFieldProps} onChange={action('change')} onSubmit={action('submit')} /> | ||||||
| <Picker defaultSelectedKey="all" {...pickerProps} onSelectionChange={action('selectionChange')}> | ||||||
| <Item key="all">All</Item> | ||||||
|
|
@@ -41,7 +41,7 @@ function render(props: Omit<SpectrumSearchWithinProps, 'children'> = {}, searchF | |||||
|
|
||||||
| function renderReverse(props: Omit<SpectrumSearchWithinProps, 'children'> = {}, searchFieldProps: SearchFieldProps = {}, pickerProps: Omit<SpectrumPickerProps<object>, 'children'> = {}) { | ||||||
| return ( | ||||||
| <SearchWithin label="Search" {...props}> | ||||||
| <SearchWithin label="Test label" {...props}> | ||||||
| <Picker defaultSelectedKey="all" {...pickerProps} onSelectionChange={action('selectionChange')}> | ||||||
| <Item key="all">All</Item> | ||||||
| <Item key="campaigns">Campaigns</Item> | ||||||
|
|
@@ -60,7 +60,7 @@ function ResizeSearchWithinApp(props) { | |||||
| return ( | ||||||
| <Flex direction="column" gap="size-200" alignItems="start"> | ||||||
| <div style={{width: state ? '300px' : '400px'}}> | ||||||
| <SearchWithin label="Search" {...props} width="100%"> | ||||||
| <SearchWithin label="Test label" {...props} width="100%"> | ||||||
| <SearchField placeholder="Search" onChange={action('change')} onSubmit={action('submit')} /> | ||||||
| <Picker defaultSelectedKey="all" onSelectionChange={action('selectionChange')}> | ||||||
| <Item key="all">All</Item> | ||||||
|
|
@@ -119,7 +119,16 @@ CustomWidth30.storyName = 'Custom width: 30'; | |||||
| export const LabelPositionSide = () => render({labelPosition: 'side'}); | ||||||
| LabelPositionSide.storyName = 'labelPosition: side'; | ||||||
|
|
||||||
| export const NoLabel = () => render({label: undefined, 'aria-label': 'Aria Label'}); | ||||||
| export const NoVisibleLabel = () => render({label: undefined, 'aria-label': 'Test aria label'}); | ||||||
|
|
||||||
| export const NoLabels = () => render({label: undefined}); | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I don't think that is necessary here. We added a comment here:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hrm, I read that as we don't need to pass the group's |
||||||
|
|
||||||
reidbarber marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| export const ExternalLabel = () => ( | ||||||
| <div style={{display: 'flex', flexDirection: 'column'}}> | ||||||
| <span id="foo">External label</span> | ||||||
| {render({label: undefined, 'aria-labelledby': 'foo'})} | ||||||
| </div> | ||||||
| ); | ||||||
|
|
||||||
| export const AutoFocusSearchField = () => render({}, {autoFocus: true}); | ||||||
| AutoFocusSearchField.storyName = 'autoFocus: true on SearchField'; | ||||||
|
|
||||||

Uh oh!
There was an error while loading. Please reload this page.