-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Adding Modal component #18156
Adding Modal component #18156
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
ui/components/component-library/badge-wrapper/badge-wrapper.types.ts
Outdated
Show resolved
Hide resolved
Builds ready [5d6cf3e]
Page Load Metrics (1637 ± 43 ms)
Bundle size diffs
|
Codecov Report
@@ Coverage Diff @@
## develop #18156 +/- ##
===========================================
- Coverage 64.11% 64.04% -0.07%
===========================================
Files 910 916 +6
Lines 35516 35604 +88
Branches 9008 9031 +23
===========================================
+ Hits 22768 22800 +32
- Misses 12748 12804 +56
... and 2 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
5d6cf3e
to
284bce6
Compare
Builds ready [284bce6]
Page Load Metrics (1567 ± 70 ms)
Bundle size diffs
|
284bce6
to
b3ab924
Compare
What's the status / ETA on this modal component? |
@eriknson hoping to get this into a reviewable state soon. Rough eta 2 weeks |
b3ab924
to
7cc9685
Compare
7cc9685
to
bb6f0b9
Compare
bb6f0b9
to
752a27d
Compare
752a27d
to
bb3d17b
Compare
232972c
to
98cffd6
Compare
98cffd6
to
174ee0d
Compare
@@ -333,6 +333,7 @@ | |||
"qrcode.react": "^1.0.1", | |||
"react": "^16.12.0", | |||
"react-dom": "^16.12.0", | |||
"react-focus-lock": "^2.9.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using react-focus-lock
library to lock focus to the ModalContent
component or to whatever component uses the modalContentRef
ref to improve the accessibility for keyboard only and screen reader users
@@ -25,6 +25,9 @@ export const ModalContent = ({ | |||
{ [`mm-modal-content--size-${size}`]: !width }, | |||
className, | |||
)} | |||
as="section" | |||
role="dialog" | |||
aria-modal="true" | |||
backgroundColor={BackgroundColor.backgroundDefault} | |||
borderRadius={BorderRadius.LG} | |||
width={width || BLOCK_SIZES.FULL} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
screenreader and semantic html improvements copied from Chakra UI
@@ -21,6 +21,7 @@ export const ModalOverlay: React.FC<ModalOverlayProps> = ({ | |||
width={BLOCK_SIZES.FULL} | |||
height={BLOCK_SIZES.FULL} | |||
onClick={onClick} | |||
aria-hidden="true" | |||
{...props} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
screenreader improvements copied from Chakra UI
|
||
# Modal | ||
|
||
The `Modal` focuses the user's attention exclusively on information via a window that is overlaid on primary content. It uses `ModalOverlay`, `ModalContent` and `ModalHeader` to create a modal dialog. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to
The `Modal` focuses the user's attention exclusively on information via a window that is overlaid on primary content. It uses `ModalOverlay`, `ModalContent` and `ModalHeader` to create a modal dialog. | |
The `Modal` focuses the user's attention exclusively on information via a window that is overlaid on primary content. It should be used with the `ModalOverlay`, `ModalContent` and `ModalHeader` components to create a complete modal. |
Builds ready [9cbf2c3]
Page Load Metrics (1506 ± 32 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Should we add a story with large amounts of content so we see how scrolling looks in the modal? |
6278584
to
cc9383e
Compare
cc9383e
to
fcd858e
Compare
Great point! I think you have identified a BIG BUG with this Modal implementation thank you!! |
Builds ready [fcd858e]
Page Load Metrics (1605 ± 42 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Explanation
Adding
Modal
component based on insight report. This PR adds the final components to complete the newModal
component as well as stories, documentation and tests. It also introduces aModalFocus
component that uses the react-focus-lock library to improve the accessibility of our Modal component for keyboard only users.Screenshots/Screencaps
After
after.mov
Text coverage for
Modal
andModalFocus
Manual Testing Steps
Modal
in the search barstories
,controls
anddocs
Pre-merge author checklist
Pre-merge reviewer checklist
If further QA is required (e.g. new feature, complex testing steps, large refactor), add the
Extension QA Board
label.In this case, a QA Engineer approval will be be required.