question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Event onClick on Each AccordionItem?

See original GitHub issue

Is there a way to add an onClick event on each AccordionItem? I need to dispatch an action every time user click the AccordionItem. I’ve tried to add onClick event directly to the AccordionItem, but it doesn’t work. This is what I’ve tried so far

<AccordionItem
  title={`Room Details for ${this.props.nights} nights`}
  titleClassName="panel-heading"
  onClick={() => this.changeActiveForm('room-breakdown')}
>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
reyhansofiancommented, Jun 4, 2016

@psimyn it’s perfect! I can use this for sure. I know it’s still break-y, just let you know that it thrown an error if the activeItem is not a number

{[1, 'two', 3, 'four', 5].map((item) => {
...

When I click the AccordionItem that have a string index, it will throw an error

warning.js:44 Warning: Failed propType: Invalid prop `activeItems` supplied to `Accordion`. Check the render method of `Demo`.
0reactions
reyhansofiancommented, Jun 7, 2016

@psimyn great works! thanks a lot

Read more comments on GitHub >

github_iconTop Results From Across the Web

AccordionItem "OnCLick" Event - Blazor Forums - Syncfusion
Hello,. I need to execute an event when the user clicks on an accordion item. I don't see any "onchange" or "onclick" event...
Read more >
onClick of ui.accordionitem, Properties Webix Docs
It blocks all further click-related events: onBeforeSelect, onAfterSelect, onSelectChange, onItemClick. To check the full stack of the blocked events, you ...
Read more >
How to open the accordion for each item when click on icon?
Move the isOpen state and toggle handler to this parent component. Use an "id" to toggle on/off the question component you want to...
Read more >
Reactive Accordion item onclick triggered - OutSystems
Hello again forum. I am trying to replicate some functionality from a traditional web app that uses a section expandable to put fields...
Read more >
OnClick even for accordion header - MSDN - Microsoft
How do I add an onClick event to each pane header of an accordion? I need it to swap an image on the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found