[Modal] Add support for onKeyDown and remove onEscapeKeyDown#23571
Merged
[Modal] Add support for onKeyDown and remove onEscapeKeyDown#23571
Conversation
Member
Author
|
There's definitely more opportunity. Some of them have equivalent behavior that we haven't settled on (e.g. preventDefault). For reviewability and changelog reasons I would work on them separately. |
eps1lon
commented
Nov 16, 2020
Comment on lines
+101
to
+107
| } else if ( | ||
| // currently tracking `inProps` which stands for the given props e.g. `function Modal(inProps) {}` | ||
| babelTypes.isIdentifier(node, { name: 'inProps' }) && | ||
| // `const props = ...` assuming the right-hand side has `inProps` as input. | ||
| babelTypes.isIdentifier(path.node.id, { name: 'props' }) | ||
| ) { | ||
| getUsedPropsInternal(path.node.id); |
Member
Author
There was a problem hiding this comment.
It's not pretty since this function has the same issue as most of the code inlined from ttp: Overloading functions to increase re-usability instead of splitting them for individual use cases.
I expect that this kind of props tracking through throughout the component might increase with the removal of withStyles at which point we can refactor this code.
Member
|
Do we miss a description of the breaking change in the migration guide and in the PR's description (I use that to generate the changelog)? |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Breaking changes
onEscapeKeyDownprop. It's redundant with thereasonargument.As far as I can tell it can be implemented in userland with
onKeyDownoronClose(+reason).It was first introduced as
onEscapeKeyUpin c644597