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

feat(carbon-react): remove label from default props #9731

Merged
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
9 changes: 7 additions & 2 deletions packages/react/src/components/OverflowMenu/OverflowMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { OverflowMenuVertical16 } from '@carbon/icons-react';
import { keys, matches as keyCodeMatches } from '../../internal/keyboard';
import mergeRefs from '../../tools/mergeRefs';
import { PrefixContext } from '../../internal/usePrefix';
import * as FeatureFlags from '@carbon/feature-flags';

const on = (element, ...args) => {
element.addEventListener(...args);
Expand Down Expand Up @@ -97,7 +98,9 @@ class OverflowMenu extends Component {
/**
* The ARIA label.
*/
ariaLabel: PropTypes.string,
ariaLabel: FeatureFlags.enabled('enable-v11-release')
? PropTypes.string.isRequired
: PropTypes.string,
Comment on lines +101 to +103
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this component, are we looking for ariaLabel or iconDescription to be the accessibility label for the component?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured iconDescription was not necessarily the accessibility label

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it could be specified but we would still allow a default?


/**
* The child nodes.
Expand Down Expand Up @@ -218,7 +221,9 @@ class OverflowMenu extends Component {
static contextType = PrefixContext;

static defaultProps = {
ariaLabel: 'open and close list of options',
ariaLabel: FeatureFlags.enabled('enable-v11-release')
? null
: 'open and close list of options',
iconDescription: 'open and close list of options',
open: false,
direction: DIRECTION_BOTTOM,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import React from 'react';
import { match, keys } from '../../internal/keyboard';
import { warning } from '../../internal/warning';
import deprecate from '../../prop-types/deprecate.js';
import * as FeatureFlags from '@carbon/feature-flags';

const { prefix } = settings;

Expand Down Expand Up @@ -100,7 +101,9 @@ export default class OverflowMenuItem extends React.Component {
hasDivider: false,
isDelete: false,
disabled: false,
itemText: 'Provide itemText',
itemText: FeatureFlags.enabled('enable-v11-release')
? null
: 'Provide itemText',
onClick: () => {},
onKeyDown: () => {},
};
Expand Down