Skip to content

Commit

Permalink
fix: a11y - add alt text for "exit" button in the editors
Browse files Browse the repository at this point in the history
  • Loading branch information
bradenmacdonald committed Sep 11, 2024
1 parent 42df1c2 commit b5e754a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ exports[`EditorContainer component render snapshot: initialized. enable save and
/>
</h2>
<IconButton
alt="Exit the editor"
iconAs="Icon"
onClick={[MockFunction openCancelConfirmModal]}
src={[MockFunction icons.Close]}
Expand Down Expand Up @@ -132,6 +133,7 @@ exports[`EditorContainer component render snapshot: not initialized. disable sav
/>
</h2>
<IconButton
alt="Exit the editor"
iconAs="Icon"
onClick={[MockFunction openCancelConfirmModal]}
src={[MockFunction icons.Close]}
Expand Down
1 change: 1 addition & 0 deletions src/editors/containers/EditorContainer/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const EditorContainer = ({
src={Close}
iconAs={Icon}
onClick={openCancelConfirmModal}
alt={intl.formatMessage(messages.exitButtonAlt)}
/>
</div>
</ModalDialog.Header>
Expand Down
5 changes: 5 additions & 0 deletions src/editors/containers/EditorContainer/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ const messages = defineMessages({
defaultMessage: 'Are you sure you want to exit the editor? Any unsaved changes will be lost.',
description: 'Description text for modal confirming cancellation',
},
exitButtonAlt: {
id: 'authoring.editorContainer.exitButton.alt',
defaultMessage: 'Exit the editor',
description: 'Alt text for the Exit button',
},
okButtonLabel: {
id: 'authoring.editorContainer.okButton.label',
defaultMessage: 'OK',
Expand Down

0 comments on commit b5e754a

Please sign in to comment.