Skip to content
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

Merged
merged 7 commits into from
May 2, 2024

Conversation

Gururajj77
Copy link
Contributor

Closes #13237

added typescript types to OverflowMenu component

Changelog

New

  • added interfaces for props, state and internal variables.

Changed

  • renamed .js file to .tsx

Testing / Reviewing

No new testing observations.

Copy link

netlify bot commented Apr 4, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 6c7da42
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/663359c6625e870008b20b87
😎 Deploy Preview https://deploy-preview-16134--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@andreancardona andreancardona left a 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!

@alisonjoseph
Copy link
Member

@Gururajj77 looks like tests are failing

@Gururajj77
Copy link
Contributor Author

@Gururajj77 looks like tests are failing

The CI failed due to outdated snapshots, updated them.

Copy link
Member

@tay1orjones tay1orjones left a 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();
Copy link
Member

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?

Copy link
Contributor Author

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
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add TypeScript types to OverflowMenu, OverflowMenuItem
4 participants