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(Modal): edit close icon alt text to match content guidelines #5700

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
Original file line number Diff line number Diff line change
Expand Up @@ -2948,7 +2948,7 @@ Map {
"Modal" => Object {
"defaultProps": Object {
"hasScrollingContent": false,
"iconDescription": "close the modal",
"iconDescription": "Close",
"modalHeading": "",
"modalLabel": "",
"onKeyDown": [Function],
Expand Down
10 changes: 2 additions & 8 deletions packages/react/src/components/Modal/Modal-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ const props = () => ({
'[data-modal-primary-focus]'
),
size: select('Size (size)', sizes),
iconDescription: text(
'Close icon description (iconDescription)',
'Close the modal'
),
iconDescription: text('Close icon description (iconDescription)', 'Close'),
onBlur: action('onBlur'),
onClick: action('onClick'),
onFocus: action('onFocus'),
Expand Down Expand Up @@ -93,10 +90,7 @@ const titleOnlyProps = () => {
'Secondary Button'
),
size: select('Size (size)', sizes, 'sm'),
iconDescription: text(
'Close icon description (iconDescription)',
'Close the modal'
),
iconDescription: text('Close icon description (iconDescription)', 'Close'),
onBlur: action('onBlur'),
onClick: action('onClick'),
onFocus: action('onFocus'),
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Modal/Modal-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('Modal', () => {
});

it('has the expected default iconDescription', () => {
expect(mounted.props().iconDescription).toEqual('close the modal');
expect(mounted.props().iconDescription).toEqual('Close');
});

it('adds new iconDescription when passed via props', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export default class Modal extends Component {
primaryButtonDisabled: false,
onKeyDown: () => {},
passiveModal: false,
iconDescription: 'close the modal',
iconDescription: 'Close',
modalHeading: '',
modalLabel: '',
selectorPrimaryFocus: '[data-modal-primary-focus]',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ exports[`ModalWrapper should render 1`] = `
<Modal
aria-label="test modal"
hasScrollingContent={false}
iconDescription="close the modal"
iconDescription="Close"
id="modal"
modalHeading="Transactional Modal"
modalLabel="Test Modal Label"
Expand Down Expand Up @@ -97,18 +97,18 @@ exports[`ModalWrapper should render 1`] = `
Transactional Modal
</h3>
<button
aria-label="close the modal"
aria-label="Close"
className="bx--modal-close"
onClick={[Function]}
title="close the modal"
title="Close"
type="button"
>
<ForwardRef(Close20)
aria-label="close the modal"
aria-label="Close"
className="bx--modal-close__icon"
>
<Icon
aria-label="close the modal"
aria-label="Close"
className="bx--modal-close__icon"
height={20}
preserveAspectRatio="xMidYMid meet"
Expand All @@ -117,7 +117,7 @@ exports[`ModalWrapper should render 1`] = `
xmlns="http://www.w3.org/2000/svg"
>
<svg
aria-label="close the modal"
aria-label="Close"
className="bx--modal-close__icon"
focusable="false"
height={20}
Expand Down