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(Menu toggle): Passed aria label prop value to typeahead variant #10084

Merged
merged 2 commits into from
Feb 19, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class MenuToggleBase extends React.Component<MenuToggleProps> {
className={css(styles.menuToggleButton)}
aria-expanded={isExpanded}
onClick={onClick}
aria-label="Menu toggle"
aria-label={ariaLabel || 'Menu toggle'}
>
{toggleControls}
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const MenuToggleTypeahead: React.FunctionComponent = () => {
};

return (
<MenuToggle variant="typeahead" isFullWidth>
<MenuToggle variant="typeahead" isFullWidth aria-label="Typeahead menu toggle">
<TextInputGroup isPlain>
<TextInputGroupMain
value={inputValue}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,14 @@ export const SelectMultiTypeahead: React.FunctionComponent = () => {
};

const toggle = (toggleRef: React.Ref<MenuToggleElement>) => (
<MenuToggle variant="typeahead" onClick={onToggleClick} innerRef={toggleRef} isExpanded={isOpen} isFullWidth>
<MenuToggle
variant="typeahead"
aria-label="Multi typeahead menu toggle"
onClick={onToggleClick}
innerRef={toggleRef}
isExpanded={isOpen}
isFullWidth
>
<TextInputGroup isPlain>
<TextInputGroupMain
value={inputValue}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,14 @@ export const SelectMultiTypeaheadCheckbox: React.FunctionComponent = () => {
}, [selected]);

const toggle = (toggleRef: React.Ref<MenuToggleElement>) => (
<MenuToggle variant="typeahead" onClick={onToggleClick} innerRef={toggleRef} isExpanded={isOpen} isFullWidth>
<MenuToggle
variant="typeahead"
aria-label="Multi typeahead checkbox menu toggle"
onClick={onToggleClick}
innerRef={toggleRef}
isExpanded={isOpen}
isFullWidth
>
<TextInputGroup isPlain>
<TextInputGroupMain
value={inputValue}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,14 @@ export const SelectMultiTypeaheadCreatable: React.FunctionComponent = () => {
};

const toggle = (toggleRef: React.Ref<MenuToggleElement>) => (
<MenuToggle variant="typeahead" onClick={onToggleClick} innerRef={toggleRef} isExpanded={isOpen} isFullWidth>
<MenuToggle
variant="typeahead"
aria-label="Multi typeahead creatable menu toggle"
onClick={onToggleClick}
innerRef={toggleRef}
isExpanded={isOpen}
isFullWidth
>
<TextInputGroup isPlain>
<TextInputGroupMain
value={inputValue}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,14 @@ export const SelectBasic: React.FunctionComponent = () => {
};

const toggle = (toggleRef: React.Ref<MenuToggleElement>) => (
<MenuToggle ref={toggleRef} variant="typeahead" onClick={onToggleClick} isExpanded={isOpen} isFullWidth>
<MenuToggle
ref={toggleRef}
variant="typeahead"
aria-label="Typeahead menu toggle"
onClick={onToggleClick}
isExpanded={isOpen}
isFullWidth
>
<TextInputGroup isPlain>
<TextInputGroupMain
value={inputValue}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,14 @@ export const SelectTypeaheadCreatable: React.FunctionComponent = () => {
};

const toggle = (toggleRef: React.Ref<MenuToggleElement>) => (
<MenuToggle ref={toggleRef} variant="typeahead" onClick={onToggleClick} isExpanded={isOpen} isFullWidth>
<MenuToggle
ref={toggleRef}
variant="typeahead"
aria-label="Typeahead creatable menu toggle"
onClick={onToggleClick}
isExpanded={isOpen}
isFullWidth
>
<TextInputGroup isPlain>
<TextInputGroupMain
value={inputValue}
Expand Down
Loading