Skip to content

Commit

Permalink
fix(Modal): edit close icon alt text to match content guidelines (#5700)
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod authored Apr 1, 2020
1 parent e83aabf commit f51b06b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 17 deletions.
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

0 comments on commit f51b06b

Please sign in to comment.