diff --git a/cypress/component/Modal.spec.tsx b/cypress/component/Modal.spec.tsx index 975d938365..c5a51c93a0 100644 --- a/cypress/component/Modal.spec.tsx +++ b/cypress/component/Modal.spec.tsx @@ -102,7 +102,7 @@ describe('Modal', () => { }); it('should trap focus inside the modal element', () => { - cy.tab().should('contain', 'Acknowledge').tab().should('contain', 'Cancel').tab(); + cy.tab().should('contain', 'Cancel').tab().should('contain', 'Acknowledge').tab(); cy.findByRole('dialog', {name: 'MIT License'}) .findByRole('button', {name: 'Close'}) .should('have.focus'); @@ -520,11 +520,11 @@ context(`given the [Components/Popups/Modal, Custom focus] story is rendered`, ( it('should trap focus inside the modal element', () => { cy.focused() - .tab() - .should('contain', 'Acknowledge') .tab() .should('contain', 'Cancel') .tab() + .should('contain', 'Acknowledge') + .tab() .should('have.attr', 'aria-label', 'Close') .tab(); cy.findByLabelText('Initials').should('have.focus'); diff --git a/modules/react/modal/stories/Modal.mdx b/modules/react/modal/stories/Modal.mdx index e0732ccca6..3fee9c1efc 100644 --- a/modules/react/modal/stories/Modal.mdx +++ b/modules/react/modal/stories/Modal.mdx @@ -1,4 +1,5 @@ import {ExampleCodeBlock, SymbolDoc, Specifications} from '@workday/canvas-kit-docs'; +import {Source, Canvas, Stories} from '@storybook/blocks' import {Basic} from './examples/Basic'; import {WithoutCloseIcon} from './examples/WithoutCloseIcon'; @@ -19,6 +20,10 @@ interaction with the rest of the page. A Modal will render the rest of the page Modal is dismissed. A Modal should be used when the user needs to presented with important information that must be interacted with before continuing interaction with the rest of the page. +>**Note: We recommend the main call-to-action button (i.e. "Acknowledge", "Submit", "Accept", etc.) be positioned after a non-call-to-action button (i.e. "Cancel", "Close", etc.)** + +>**This allows a user to view all of their options when making a decision on which button to click for a Modal.** + ## Installation ```sh diff --git a/modules/react/modal/stories/examples/Basic.tsx b/modules/react/modal/stories/examples/Basic.tsx index 1c2a899b53..920df6e7cc 100644 --- a/modules/react/modal/stories/examples/Basic.tsx +++ b/modules/react/modal/stories/examples/Basic.tsx @@ -27,10 +27,10 @@ export const Basic = () => { + Cancel Acknowledge - Cancel diff --git a/modules/react/modal/stories/examples/BodyOverflow.tsx b/modules/react/modal/stories/examples/BodyOverflow.tsx index b0ba2e59f2..98866891db 100644 --- a/modules/react/modal/stories/examples/BodyOverflow.tsx +++ b/modules/react/modal/stories/examples/BodyOverflow.tsx @@ -82,10 +82,10 @@ export const BodyOverflow = () => {

+ Cancel Acknowledge - Cancel diff --git a/modules/react/modal/stories/examples/CustomFocus.tsx b/modules/react/modal/stories/examples/CustomFocus.tsx index 036a17c84c..e346a05d6a 100644 --- a/modules/react/modal/stories/examples/CustomFocus.tsx +++ b/modules/react/modal/stories/examples/CustomFocus.tsx @@ -40,10 +40,10 @@ export const CustomFocus = () => { + Cancel Acknowledge - Cancel diff --git a/modules/react/modal/stories/examples/FullOverflow.tsx b/modules/react/modal/stories/examples/FullOverflow.tsx index 328c579cce..97d8fd49ac 100644 --- a/modules/react/modal/stories/examples/FullOverflow.tsx +++ b/modules/react/modal/stories/examples/FullOverflow.tsx @@ -82,10 +82,10 @@ export const FullOverflow = () => {

+ Cancel Acknowledge - Cancel diff --git a/modules/react/modal/stories/examples/IframeTest.tsx b/modules/react/modal/stories/examples/IframeTest.tsx index 82e55ffe34..ea3e50c9fc 100644 --- a/modules/react/modal/stories/examples/IframeTest.tsx +++ b/modules/react/modal/stories/examples/IframeTest.tsx @@ -14,8 +14,8 @@ export const IframeTest = () => {

Are you sure you want to delete the item?

- Delete Cancel + Delete