-
Notifications
You must be signed in to change notification settings - Fork 842
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
Adds side nav toggle #1701
Adds side nav toggle #1701
Conversation
@ryankeairns Let me know if you want me to hop in to fix any of the issues above. I haven't looked at the code yet, just did a quick functionality review. |
@cchaos thanks for the quick review. I'll dig into 1. removing the delay which I suspect will also address 5. cleaning up animation. If you could take a look at 4., independent scrolling that would be very helpful. On the topic of scrolling, I can't replicate number 2., perhaps it's our OS differences again. Regarding 3., I know the clickdetector code is a little wonky... what steps lead you to that state? |
I only see one |
Oh I see what's going on, I think, but I was testing it in Chrome's responsive dev tools option, which doesn't have hover (like touch devices) and it looks like you're still closing the sub-menu when hovering outside of it. What do you think about completely getting rid of all hover to open/close options and just stick to clicking in/out to open/close? |
@thompsongl I didn't re-attempt it in this PR, but originally (iirc) it was placed around the flyout sub menu and while it trapped the focus the initial link would not become focused. Chandler helped at the time and I've not since revisited it... it's worth another shot if you're interested :) otherwise it's something we can circle back to after 7.0.x. |
I'm down with that! The hover interactions (I think) have all been removed, so it would just be the |
That's probably best. I think we'd be looking at adding more than one additional |
@ryankeairns Can you rebase with master? |
…he "now" time selection (elastic#1620)" This reverts commit 255d330.
c47d9eb
to
d4c6b63
Compare
…rigger the "now" time selection (elastic#1620)"" This reverts commit d74f18f.
FYI, I reverted a bad revert and pushed directly to this branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So close. Just a few refactoring issues.
Also, there's a console error when using the extraAction onClick: () => this.expandFlyout()
. It is now throwing errors because this.expandFlyout()
no longer exists in the src-docs.
Simplify flyout children logic by adding `EuiNavDrawerGroup`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve this now with the caveat that the few docs comments I left get updated, the closeFlyout function gets called on clicking the flyout button a second time, and there's a final engineer pass.
😓 Whew. Almost there. Crazy how such a simple looking component can actually be quite complicated.
Great job @ryankeairns !
by applying the common/determined linkItem props directly in the drawer group
@ryankeairns I realized that you were declaratively styling how the side nav should look by adding size, style, and aria-label props for every linkItem in the consumer doc. I created a pr that simplifies this for the consumer by applying those "default" props directly inside of the drawer group (though they are still overridable if applied in the object). This also allowed moving the list item style overrides into it's own folder and applied under it's own SASS file (for readability). |
More cleanup
This reverts commit b4b6fe1.
.. If it can be truncated. But this means it also had to be passed down one more level from list group.
…to direct/rk/side-nav-2
Ok I think this PR is ready to roll, if someone wants to do a final quick scan of the code. I just tested in Chrome, FF and IE. |
@cchaos I'm looking right now 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Follow up work: #1719
Thanks for getting this merged!! |
Summary
This PR changes
EuiNavDrawer
from a hover-to-expand to a toggle-to-expand interaction where the latter is done via a fixed bottom button. Along with this, the drawer is now collapsed by default, shows tool tips on hover (optionally), and only allows for one panel to be open at a time (previously both the main and sub menu could be expanded next to each other).Code re-organization
These changes resulted in a fair bit of code reorganization to simplify the implementation for users, however this code has remained largely the same, functionally speaking. In other words, most of the state and interaction 'guts' lived in the docs example (and in Kibana) and have since been moved into the main
EuiNavDrawer
component. Additionally, I have rolled the formerEuiNavDrawerMenu
component intoEuiNavDrawer
(and removed that component file) since it was essentially just a simple wrapper.Flyout sub menu generation
The flyout/sub menu has also been moved into
EuiNavDrawer
and is generated based upon the structure of thelistItems
data via a newflyoutMenu
prop.Fullscreen docs example
The docs example has also been upgraded to a fullscreen format which better approximates how it will be implemented. Previously, it was in a small envelope that made for some challenging positioning and docs-only style overrides.
Preview
Known issues
Checklist