-
Notifications
You must be signed in to change notification settings - Fork 387
fix(aria): make aria-* component props consistent #1731
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 1 commit
eddd52a
d77bbab
2414488
967e2a9
29d5f0a
b7c824a
658381f
d7b6f0a
ccedbe9
10ec018
c2ea61a
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 |
|---|---|---|
|
|
@@ -25,7 +25,7 @@ export const propTypes = { | |
| /** Indicates where menu will be alligned horizontally */ | ||
| position: PropTypes.oneOf(Object.values(ApplicationLauncherPosition)), | ||
| /** Adds accessible text to the button. Required for plain buttons */ | ||
| 'aria-label': PropTypes.string | ||
| 'aria-label-button': PropTypes.string | ||
|
Contributor
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. Let's use |
||
| }; | ||
|
|
||
| export const defaultProps = { | ||
|
|
@@ -36,7 +36,7 @@ export const defaultProps = { | |
| onSelect: Function.prototype, | ||
| onToggle: Function.prototype, | ||
| position: ApplicationLauncherPosition.left, | ||
| 'aria-label': 'Actions' | ||
| 'aria-label-button': 'Actions' | ||
| }; | ||
|
|
||
| class ApplicationLauncher extends React.Component { | ||
|
|
@@ -50,7 +50,7 @@ class ApplicationLauncher extends React.Component { | |
|
|
||
| render() { | ||
| const { | ||
| 'aria-label': ariaLabel, | ||
| 'aria-label-button': ariaLabel, | ||
| dropdownItems, | ||
| className, | ||
| isOpen, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ const propTypes = { | |
| /** Content rendered inside the chip text */ | ||
| children: PropTypes.node, | ||
| /** Aria Label for close button */ | ||
| 'aria-label': PropTypes.string, | ||
| 'aria-label-button': PropTypes.string, | ||
|
Contributor
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. Let's use |
||
| /** Additional classes added to the chip item */ | ||
| className: PropTypes.string, | ||
| /** Flag indicating if the chip has overflow */ | ||
|
|
@@ -24,7 +24,7 @@ const propTypes = { | |
|
|
||
| const defaultProps = { | ||
| children: null, | ||
| 'aria-label': 'close', | ||
| 'aria-label-button': 'close', | ||
| className: '', | ||
| isOverflowChip: false, | ||
| tooltipPosition: 'top', | ||
|
|
@@ -53,7 +53,7 @@ class Chip extends React.Component { | |
| }; | ||
|
|
||
| renderChip = randomId => { | ||
| const { children, 'aria-label': ariaLabel, tooltipPosition, className, onClick } = this.props; | ||
| const { children, 'aria-label-button': ariaLabel, tooltipPosition, className, onClick } = this.props; | ||
| if (this.state.isTooltipVisible) { | ||
| return ( | ||
| <Tooltip position={tooltipPosition} content={children}> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,7 @@ const propTypes = { | |
| /** Text that appears in the Context Selector Toggle */ | ||
| toggleText: PropTypes.string, | ||
| /** aria-label for the Context Selector Search Button */ | ||
| 'aria-label': PropTypes.string, | ||
| 'aria-label-search': PropTypes.string, | ||
|
Contributor
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. Let's use |
||
| /** Value in the Search field */ | ||
| searchInputValue: PropTypes.string, | ||
| /** Function callback called when user changes the Search Input */ | ||
|
|
@@ -51,7 +51,7 @@ const defaultProps = { | |
| onSelect: () => { }, | ||
| screenReaderLabel: '', | ||
| toggleText: '', | ||
| 'aria-label': 'Search menu items', | ||
| 'aria-label-search': 'Search menu items', | ||
| searchInputValue: '', | ||
| onSearchInputChange: () => { }, | ||
| searchInputPlaceholder: 'Search', | ||
|
|
@@ -79,7 +79,7 @@ class ContextSelector extends React.Component { | |
| onSelect, | ||
| screenReaderLabel, | ||
| toggleText, | ||
| 'aria-label': ariaLabel, | ||
| 'aria-label-search': ariaLabel, | ||
| searchInputValue, | ||
| onSearchInputChange, | ||
| searchInputPlaceholder, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,8 +24,8 @@ const propTypes = { | |
| onNavToggle: PropTypes.func, | ||
| /** True if the side nav is shown */ | ||
| isNavOpen: PropTypes.bool, | ||
| /** Callback function to handle the side nav toggle button */ | ||
| 'aria-label': PropTypes.string, | ||
| /** aria-label for the button */ | ||
| 'aria-label-button': PropTypes.string, | ||
|
Contributor
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. Let's use |
||
| /** Additional props are spread to the container <header> */ | ||
| '': PropTypes.any | ||
| }; | ||
|
|
@@ -40,7 +40,7 @@ const defaultProps = { | |
| showNavToggle: false, | ||
| isNavOpen: true, | ||
| onNavToggle: () => undefined, | ||
| 'aria-label': 'Global navigation' | ||
| 'aria-label-button': 'Global navigation' | ||
| }; | ||
|
|
||
| const PageHeader = ({ | ||
|
|
@@ -53,7 +53,7 @@ const PageHeader = ({ | |
| isNavOpen, | ||
| showNavToggle, | ||
| onNavToggle, | ||
| 'aria-label': ariaLabel, | ||
| 'aria-label-button': ariaLabel, | ||
| ...props | ||
| }) => ( | ||
| <header role="banner" className={css(styles.pageHeader, className)} {...props}> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to discussion in slack, let's use
ariaLabelCloseinstead.