patternfly / patternfly-react

A set of React components for the PatternFly project.
https://react-staging.patternfly.org/
MIT License
794 stars 356 forks source link

PF4 dropdown onToggle event #1022

Closed dlabrecq closed 5 years ago

dlabrecq commented 5 years ago

I'm having an issue with PF4 events in the Koku UI/Insights platform; in particular, with the PF4 dropdown toggle.

When I have more than one PF4 dropdown component in the same page, and I click on the first menu to expand, I noticed that my onToggle function for the second menu is called. The argument provided to my second onToggle function is false, so the menu does not expand; however, this should not be called at all IMO. The functionality appears to behave as if both components have the same parentRef?

jiridostal commented 5 years ago

I'm experiencing exactly the same behavior. I did not figure out how to use multiple dropdowns on one page.

dlabrecq commented 5 years ago

I've included a video/gif demonstrating that clicking on the "Group By" dropdown toggle invokes the handleSortByToggle function of my "Sort By" dropdown toggle.

dropdowns

My first "Group By" dropdown can be found here: https://github.com/project-koku/koku-ui/blob/master/src/pages/ocpDetails/ocpDetails.tsx#L350

The second "Sort By" dropdown is located here: https://github.com/project-koku/koku-ui/blob/master/src/pages/ocpDetails/detailsToolbar.tsx#L250

dlabaj commented 5 years ago

@dlabrecq I can't reproduce this with the PF4 Seed app https://github.com/dlabaj/patternfly-react-seed/tree/issue_1022 Is this still a problem? If so can you update the seed app to reproduce this.

dlabrecq commented 5 years ago

I've replaced the PF4 dropdown while introducing the PF4 table sort. Thus, we no longer have multiple dropdowns on the same page. Unfortunately, I don't have time to recreate the previous page.

Perhaps @jiridostal can confirm if this is still an issue?

dlabaj commented 5 years ago

@dlabrecq No worries. If @jiridostal can reproduce it with the app above let me know.

dlabaj commented 5 years ago

Closing since we are unable to reproduce.