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

feat: Enable custom on click handler passed via accordion item #2998

Merged
merged 2 commits into from
Aug 12, 2024

Conversation

kleinschmidtj
Copy link
Contributor

@kleinschmidtj kleinschmidtj commented Aug 5, 2024

Summary

Users pass in items to the Accordion component and those items could have custom onClick handlers that fire via the handleToggle prop. (For example, custom GA tracking events described in the below issue.) This change actually implements firing those passed-in functions.

Related Issues or PRs

addresses #2739

How To Test

In Accordion.stories.tsx, add a line to the first item in the testItems array:

    handleToggle: () => {
      console.log('hello')
    },

Open one of the Accordion stories in Storybook, open the developer console, click the first Accordion item and you should see "hello" appear.

Screenshots (optional)

@kleinschmidtj kleinschmidtj requested a review from a team as a code owner August 5, 2024 16:29
Copy link
Contributor

github-actions bot commented Aug 5, 2024

Warnings
⚠️ This PR does not include changes to storybook, even though it affects component code.

Generated by 🚫 dangerJS against d1d9ae6

@kleinschmidtj kleinschmidtj changed the title [feat] Enable custom on click handler passed via accordion item feat: Enable custom on click handler passed via accordion item Aug 5, 2024
Copy link
Contributor

@brandonlenz brandonlenz left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for wiring this up!

@kleinschmidtj kleinschmidtj merged commit 420483a into main Aug 12, 2024
7 of 9 checks passed
@kleinschmidtj kleinschmidtj deleted the jfk-export-accordion-item branch August 12, 2024 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants