- Issue created by @ckrina
- Assigned to claireristow
- Issue was unassigned.
- π¨π¦Canada claireristow
I'm struggling to find the solution for this one. Adding overflow-y: scroll; to the sidebar when it's collapsed means the tooltips and flyouts are hidden. I am going to unassign myself for now in case someone else can pick this up.
- First commit to issue fork.
- @hooroomoo opened merge request.
- πΊπΈUnited States hooroomoo
Pushed a commit for flyout menu to appear when collapsed but still need to address the tooltips that aren't displayed correctly
- Assigned to hooroomoo
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 3:56pm 11 August 2023 - Status changed to Needs work
over 1 year ago 1:05pm 14 August 2023 - πͺπΈSpain ckrina Barcelona
I've just tested it and looks great! But I've found one small bug: the sticky menu at the bottom gets its "tooltips" and user sub-menu cut and won't show beyond the sidebar region. Here's an screenshot:
- Status changed to Needs review
over 1 year ago 5:32pm 14 August 2023 - π¨π¦Canada claireristow
Those changes look great @hooroomoo, thanks so much for taking this! Just approved the MR, I think it's safe to merge :)
- Status changed to Needs work
over 1 year ago 12:52pm 15 August 2023 - πͺπΈSpain ckrina Barcelona
I confirm it works with Chrome, but not with Firefox. So moving to NW, sorry!
- πΊπΈUnited States hooroomoo
i'm having trouble finding a solution for firefox so if anyone else wants to jump on this please feel free
- Assigned to claireristow
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 8:23pm 17 August 2023 - π¨π¦Canada claireristow
I believe the Firefox issue is resolved now. Ready for another review!
- Status changed to RTBC
over 1 year ago 5:54pm 22 August 2023 - πΊπΈUnited States hooroomoo
Tested on chrome, firefox, and safari and it looks good to me. Pushed a small fix to Safari because the flyouts and tooltips were getting clipped when there was overflow.
I will point out that the scrollable elements don't include the Drupal icon and Bookmarks after the Safari fix since the fix was to add overflow: y to the element which excludes the Drupal icon and Bookmarks.
- π¨π¦Canada claireristow
Thanks for catching that safari issue @hooroomoo!
I will point out that the scrollable elements don't include the Drupal icon and Bookmarks after the Safari fix since the fix was to add overflow: y to the element which excludes the Drupal icon and Bookmarks.
I'm not sure if this is the right solution, as it's not visually apparent what area can be scrolled. Shadows would help but we might want some input for @ckrina if we go this route.
The overarching issue here is that "setting one axis to visible (the default) while setting the other to a different value results in visible behaving as auto" (source: MDN). So some browsers are allowing the overflow: visible for the flyouts and tooltips but others (eg. safari) are not.
I wonder if we need to look into taking the markup for the flyouts out of the sidebar altogether but that could introduce a whole other set of issues, likely including accessibility issues since the DOM order wouldn't be logical.
@ckrina or @mherchel, I'd love to get your thoughts on this.
For some reason tugboat isn't working on this issue so I've uploaded a quick recording of it's current state.
- Status changed to Needs work
over 1 year ago 12:41pm 25 August 2023 - πͺπΈSpain ckrina Barcelona
Thanks both! Yeah, having the logo and bookmarks as not scrollable is not the desirable solution. Bookmarks should be part of the navigation as much as the custom menu. In fact, I'd suggest to move the Bookmarks to the navigation itself. And right now having the logo sticky at the top doesn't give any value and takes away useful space to use to scroll. But I'd keep the header grouping for now, though. Basically, everything on the sidebar but the sticky bottom should scroll together.
And we can move the shadow into a follow-up, but ideally it should be implemented because it's an important visual clue when submenus are opened.
Another result of this change is that the last element at the bottom won't show the outline. Either switching the current margin to padding or adding extra padding would solve this small issue.
- πΊπΈUnited States mherchel Gainesville, FL, US
I've taken a bit of a look at this and have a couple thoughts:
- As noted by the comments above, it's not possible to let content
overflow:visible
in one axis, and do aoverflow:auto
in another. To work around this, we'll need to dynamically append the flyout submenus to the end of the DOM (before</body>
), and absolutely position them via FloatingUI. This is possible, but will take a bit of work, and refactoring. - My main question is if this fix is needed for testing. At some point the JavaScript will need to be refactored into more specific functions, better usage of Drupal Behaviors, etc. Because of the nature of the rapid development and changes, it's looking somewhat jQuery-ish, with everything in one big behavior. My thought is that if this doesn't affect the testing, we should postpone this until we can refactor the JS. In the meantime, we should concentrate on items that directly affect the tests including getting this to work on mobile.
Thoughts?
- As noted by the comments above, it's not possible to let content
- πΊπΈUnited States mherchel Gainesville, FL, US
@finnsky - Glad I checked this. I was in the process of doing a lot of the same. I'm about to commit the JS with updated documentation.
- Assigned to claireristow
- π¨π¦Canada claireristow
I'm going to start working on this again, starting with a new branch and implementing @mherchel's suggestion:
we'll need to dynamically append the flyout submenus to the end of the DOM (before ), and absolutely position them via FloatingUI
- π·πΈSerbia finnsky
@claireristow btw it may work with FloatingUI elements in fixed(not absolute) position.
- @claireristow opened merge request.
- π¨π¦Canada claireristow
Hey @finnsky, thank you so much for the suggestion!
I just did a quick test on my local and it worked! There's even an explanation about our exact problem in the floatingUI docs with suggestions to used fixed positioning instead. This method will likely save a lot of js work and future headaches! I didn't see your comment until after I pushed up some WIP stuff on my new `3380251-scroll-refactor-flyouts` branch but I'm going to start a third branch with the "fixed" method.
- π¨π¦Canada claireristow
Oops, false alarm. Sadly the "fixed" method doesn't work in all browsers. Darn Safari! I'm going to keep working on my refactor flyouts branch.
- π¨π¦Canada claireristow
I have a working example up at the tugboat link with two bugs that I need to spend more time on. Just noting them here for myself or in case others are reviewing and see these:
- When the sidebar is collapsed, if you slowly mouseover an icon from the right, it will flicker open and then closed.
- The "autoExpandToActiveMenuItem" function is being called before a "closeAllSubmenus" call which closes the active trail in the flyout. I think closeAllSubmenus is being used in too many places so some re-factoring may be needed there.
I haven't yet started on the keyboard nav and focus handling now that we've messed with the DOM structure. I would like some guidance an what is expected for this. Here are my questions:
- What is expected when you tab to a sidebar icon (in the collapsed state). Should the flyouts/tooltips show on focus, on "enter", or other. Maybe different experiences between flyouts and tooltips since one is a button and one is a link?
- Should flyouts have a focus trap?
- πΊπΈUnited States mherchel Gainesville, FL, US
Should flyouts have a focus trap?
No. The point of a focus trap is to disable anything from gaining focus while not visible (if it's behind a flyout or modal). We might need to add logic to have the flyouts close on blur (focusout), but that can be outside of this.
- Issue was unassigned.
- Status changed to Needs review
about 1 year ago 4:29pm 28 September 2023 -
ckrina β
committed 8b88c047 on 1.x authored by
claireristow β
Issue #3380251: Scroll the sidebar when it's collapsed
-
ckrina β
committed 8b88c047 on 1.x authored by
claireristow β
- Status changed to Fixed
about 1 year ago 4:58pm 1 October 2023 - πͺπΈSpain ckrina Barcelona
Thanks @claireristow! I've tested it manually and locally, and I've done a quick review to the code. This MR is solving A LOT of bugs, plus this will unblock the mobile implementation. So merging this and we can refactor anything we find later on.
Automatically closed - issue fixed for 2 weeks with no activity.