Skip to content

fix: Call MenuItem onClick if provided#477

Merged
gnapse merged 1 commit intodevfrom
ernesto/menuitem-onclick
Mar 31, 2021
Merged

fix: Call MenuItem onClick if provided#477
gnapse merged 1 commit intodevfrom
ernesto/menuitem-onclick

Conversation

@gnapse
Copy link
Copy Markdown
Contributor

@gnapse gnapse commented Mar 26, 2021

Short description

A MenuItem element should support receiving a onClick event handler. A good motivation to do it is to catch the click event early, and possibly call event.preventDefault(), which should prevent the menu item's selection action to happen.

PR Checklist

  • Added tests for bugs / new features
  • Updated docs (storybooks, readme)
  • Executed npm run validate and made sure no errors / warnings were shown
  • Described changes in CHANGELOG.md
  • Bumped version in package.json and package-lock.json (npm --no-git-tag-version version <major|minor|patch>) ref
  • Updated all static build artifacts (npm run build-all)

Versioning

I consider this a bug fix, since the onClick handler is already supported in the prop types, but we were not calling it internally. Hence this marks a new patch release.

@gnapse gnapse added Versioning:Bug-Fix PRs that would result in a patch version release Component:Menu labels Mar 26, 2021
@gnapse gnapse requested a review from a team March 26, 2021 22:31
@gnapse gnapse self-assigned this Mar 26, 2021
@gnapse gnapse requested review from Bloomca and removed request for a team March 26, 2021 22:31
Comment thread src/components/menu/menu.tsx
@gnapse gnapse force-pushed the ernesto/menuitem-onclick branch from 444b943 to 540f3fe Compare March 31, 2021 12:12
@gnapse gnapse merged commit 6ec5e4e into dev Mar 31, 2021
@gnapse gnapse deleted the ernesto/menuitem-onclick branch March 31, 2021 12:17
@gnapse
Copy link
Copy Markdown
Contributor Author

gnapse commented Mar 31, 2021

@frankieyan any idea why the new package version has not been published yet? It seems more than enough time since I merged this. And I do not see the publish action triggered.

@frankieyan
Copy link
Copy Markdown
Member

frankieyan commented Mar 31, 2021

The action is run when a release is created 👍

@gnapse
Copy link
Copy Markdown
Contributor Author

gnapse commented Mar 31, 2021

Ah, I thought a push was enough. Thanks!

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

Labels

Component:Menu Versioning:Bug-Fix PRs that would result in a patch version release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants