-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Modal component #6261
Merged
Modal component #6261
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit
Hold shift + click to select a range
bf9f287
Initial implementation modal
aba9636
removed style prop assignment causing error
b0700fb
Set default mount node to #wpwrap
66367dd
Implemented default styling
aca49d0
Improved styling
3a5d75c
Applied code review feedback to with-focus-contain HOC
371e66b
Added eslint ignore for jsx-a11y/no-static-element-interactions
bd48b5a
Implemented withGlobalEvents HOC
809bfdd
withGlobalEvents HOC now forwards refs
47219be
Replace lodash defer with withSafeTimeout
9b93633
Removed unnecessary return statements
de29a46
Created separate styling rules
4a1b2c4
Added documentation for forwardRef function
1092fbd
Made mount location for modal configurable
44d91d3
Renamed elementId to appElementId for clarity
4aef9b6
Added noop for when no reg is provided in forwardRef
5c0568c
Fixed error in EditorProvider
887193d
Fix eslint errors
b0c4d82
Fixed incorrectly bound function
f25b989
Modal now by default mounts to the body and hides all other elements
c360742
hideApp no longer unhides elements that already had a aria-hidden=tru…
984ef8e
Improved a11y and updated documentation
6563c63
Updated documentation
59255ff
Removed forwardRef from element|
c6ee481
Changed default close label to Close dialog
17b7957
Add modal-open className to body when modal is opened
c4b433b
Added documentation to modal/index.js
cca2a0e
Removed aria-modal=true and explained why in aria-helper.js
21a722c
Documented modal/frame.js
9313ecb
Merge branch 'master' into add/modal
xyfi f487f22
Merge branch 'master' into add/modal
atimmer a66f5b8
Merge branch 'master' into add/modal
abotteram 359774d
Merge branch 'add/modal' of https://github.com/WordPress/gutenberg in…
abotteram e7a8f4f
Addressed eslint issues
abotteram 94a3216
Polish the visuals a bit.
064adbc
Merge branch 'master' into add/modal
abotteram 832b1ac
Merge branch 'add/modal' of https://github.com/WordPress/gutenberg in…
abotteram 6ac30dd
Disabled jsx-a11y/no-static-element-interactions in render function o…
abotteram 349b068
Merge branch 'master' into add/modal
abotteram d1d2ba6
Merge branch 'master' into add/modal
abotteram eda32a6
Addressed CR concerns
abotteram dde71f2
Removed unused variable
abotteram ca8512a
Replaced focus.tabbables.find from @wordpress/utils with @wordpress/dom
abotteram afdaa2c
Merge branch 'master' into add/modal
abotteram b6ef31f
Fixed failing tests after updating react-test-renderer to version 16.…
abotteram b74d1e6
CSS Tweaks
abotteram dbac197
Fixed error when clicking outside of the modal
abotteram 61ac955
Move focus to first element with tabindex=-1 on mount
abotteram d94e4ef
Make sure the dic the modal is renderd in is apprended to the documen…
abotteram 6eb3886
Addressed minor codestyle issues in frame.js
abotteram ee6f520
Fixed bug when opening modal the second time
abotteram ca59960
Removed unused import
abotteram e2a50a1
replaced react-click-outside with internal withFocusOutside HOC
abotteram 010f223
Merge branch 'master' into add/modal
abotteram 9968113
Replaced withFocusContain with withConstrainedTabbing
abotteram 5dc9b58
Replaced withFocusOutside with react-click-outside again
abotteram 7f82944
Replaced @wordpress/utils keycodes with @wordpress/keycodes in frame.js
abotteram 146f562
don't pass props.aria.labelledby to frame div when props.contentLabel…
abotteram 30ab946
Added logic and tests for aria-helper to not hide (implicitely) live …
abotteram bd1050b
Removed isOpen props from the modal
abotteram d5f50d1
Removed the ability to add inline styles to the modal
abotteram 2a0c916
Removed useless css
abotteram 9400adc
Removed redundant z-index
abotteram a956732
Add full page overlay
abotteram 0679405
Don't render h1 tag when no title is provided
abotteram 4e3bb1a
Made modal screen-verlay full screen
abotteram 12dd5fe
generate unique id for modal labelledby attribute
abotteram f607330
Replaced function scoped array liveRegionAriaRoles with file scoped c…
abotteram 40cc3f9
Removed check whtehr forwardedRef is defined
abotteram 0590e39
Minor JSDoc improvement
abotteram 6f57d08
Removed styles from defaultProps
abotteram c547404
Documentation improvements
abotteram 4eba6c7
don't add labelledBy attribute to modal frame when no title is present
abotteram 9ee5b83
Don't add unique id to headingId when aria.labelledby prop is provide…
abotteram 1a0bf75
Components: Reorder component lifecycle as first class members
aduth 8778706
Components: Use withInstanceId to generate modal heading id
aduth 6a43d9f
Components: Fix modal withInstanceId import reference
aduth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Don't add unique id to headingId when aria.labelledby prop is provide…
…d, also added aria.labelledby change logic
- Loading branch information
commit 9ee5b83912631c5110dcd1916465c613b59083e8
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
componentWillReceiveProps
is effectively deprecated.https://reactjs.org/docs/react-component.html#the-component-lifecycle
For this type of usage, you may consider
static getDerivedStateFromProps
instead:https://reactjs.org/docs/react-component.html#static-getderivedstatefromprops
However, in this case I don't think this requires state. I think we can just use the
withInstanceId
higher-order component.I will make these revisions in an upcoming commit.