-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
refactor(overflowmenu): added typescript types for overflowmenu #16134
Conversation
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
🔥 nice work on this one!
@Gururajj77 looks like tests are failing |
The CI failed due to outdated snapshots, updated them. |
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.
Just two questions, otherwise this looks good to me
@@ -297,13 +437,13 @@ class OverflowMenu extends Component { | |||
evt.stopPropagation(); | |||
if (!this._menuBody || !this._menuBody.contains(evt.target)) { | |||
this.setState({ open: !this.state.open }); | |||
onClick(evt); | |||
onClick(); |
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.
Could consumers be relying on the evt
to be passed as it was before?
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.
I am passing the evt now, and changed the type signature to accept a parameter optionally.
@@ -347,11 +487,11 @@ class OverflowMenu extends Component { | |||
this.state.open && | |||
(!this._menuBody || !this._menuBody.contains(evt.target)) | |||
) { | |||
this.closeMenu(); | |||
this.closeMenu(); // Fix: Pass the onCloseMenu callback when calling closeMenu |
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.
Is this fixed? Or an outdated comment maybe?
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.
Its an outdated comment, I had added for my own reference, forgot to remove it.
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.
LGTM!
f03c8d2
Closes #13237
added typescript types to OverflowMenu component
Changelog
New
Changed
Testing / Reviewing
No new testing observations.