-
-
Notifications
You must be signed in to change notification settings - Fork 32.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] Add support for onKeyDown and remove onEscapeKeyDown #23571
Conversation
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.
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. |
} 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); |
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.
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.
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)? |
Breaking changes
onEscapeKeyDown
prop. It's redundant with thereason
argument.As far as I can tell it can be implemented in userland with
onKeyDown
oronClose
(+reason
).It was first introduced as
onEscapeKeyUp
in c644597