Close nav drawer and flyout on nav item click#1770
Close nav drawer and flyout on nav item click#1770ryankeairns wants to merge 1 commit intoelastic:masterfrom
Conversation
8f38f02 to
0970560
Compare
|
We've (@snide and I) had some discussions around this behavior lately (applying both We should discuss how to handle the edge cases. Whether it's to use a button if both are present and the onClick lastly calls |
|
@cchaos Ryan and I talked yesterday, and I was ok with both in this case. I do think that allowing both is something we do not want to expose broadly, though. My thought here was that there are very few cases where the the I'd like to see a way to keep the thrown error in place for cases outside of this. |
|
Thank you both for your feedback. @thompsongl I had an "override href warning" prop so that you are explicitly and knowingly making this decision. Does that fit what you are envisioning? |
|
I think my concern is that we're altering the |
|
It may be that we want to address this case more holistically, because @cchaos point is valid. And I'm struggling to come up with an error solution that doesn't involve either an exposed prop or duplicating |
onClick always happens first, which allows calling |
|
Is there a way that the Keeping in mind, we don't want this to happen on the footer item click or on items that have a flyout. |
|
Closed in favor of #1773 |
Summary
This change will fix a Kibana issue elastic/kibana#30331 where the expanded nav drawer will remain open if you navigate to the app that you are already viewing. In other words, there is no refresh so the menu doesn't get reloaded to the collapsed state. I noticed this can also happen with the flyout - if it's open and you click on an app icon in the main menu, the flyout stays open. This PR addresses both cases.
Reviewer note
This change necessitates having both an
hrefand anonClickon the nav list items. Previously, I had added a console warning in the case where both were provided, since theonClickwas not being handled. With this change,onClickis now being handled so I have removed that warning and the related test.Further, I have added a Prop note on the
EuiListItemonClickthat indicates a customonClickwill be applied when nohrefis provided. This reflects the current logic inEuiListItem.Demo
Checklist
This required updates to Framer X components