Drawer closes when moving from the opening item to "popover"

Created on 1 April 2024, 8 months ago
Updated 18 April 2024, 8 months ago

Problem/Motivation

Currently, when you move from the first menu item you want to hover (ie "Configuration") to go to the drawer to interact with any of the children, it will probably close before you reach your target. The reason is that you're leaving the target item ("configuration", without entering the other target ("configuration drawer-popover").

In a lot of places this is solved with a small delay, but it makes the interaction a bit slower. But Drupal's admin UI is a working space where people will want fast response and interaction times.

Proposed resolution

Implement a solution that doesn't add extra reaction time but that improves the current interaction.

Amazon and Angular, for example, implemented a solution that detects the direction of the cursorโ€™s path:


If the cursor moves into the blue triangle the currently displayed submenu will stay open for just a bit longer. Image from Ben Kamens blog post.

Thanks to @lauriii for sharing this really useful post.

Remaining tasks

Update the interaction.

User interface changes

๐Ÿ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡ช๐Ÿ‡ธSpain ckrina Barcelona

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @ckrina
  • ๐Ÿ‡ท๐Ÿ‡ธSerbia finnsky

    Gonna work on it.

  • Merge request !219Js polishing. - #3437401 โ†’ (Merged) created by finnsky
  • Pipeline finished with Success
    8 months ago
    Total: 216s
    #134725
  • Pipeline finished with Success
    8 months ago
    Total: 212s
    #134803
  • Pipeline finished with Success
    8 months ago
    Total: 209s
    #134808
  • Status changed to Needs review 8 months ago
  • ๐Ÿ‡ท๐Ÿ‡ธSerbia finnsky

    The main problem we have now is that some things in the scripts were done for a completely different menu and other scenarios.

    I've added controlled hover open.

    On hover we wait for 500ms and then check if button not opened by click yet, or button still hovered.

    Looks much smoother than before.

    Also in this MR i've commented few things which should be reworked or at least discussed.

    1. Imo we don't need to close all popovers on any tooltip open. This is current behaviour https://gyazo.com/b8eff73a5e9ea7cbdba0047f8ce953cc and i'm fine with it

    2. ScrollIntoView on active url in popover. It looks weird now, probably we only need to activate this ONLY when active url is far outside from scroll area.

    I think we can move that ^ 2 things into separated issues/discussions.

    3. Added fix for this. We have 2 levels on menu. So we need to avoid cases when open child menu closes parent.
    https://www.drupal.org/project/navigation/issues/3437375 ๐Ÿ› There should be only one submenu expanded in the drawer at a time Active

    Please review.

    SB: https://sparkling-gaufre-c402f2.netlify.app/iframe.html?args=&id=page--b...

  • Pipeline finished with Success
    8 months ago
    Total: 213s
    #135048
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Kanchan Bhogade

    Hi,
    I've tried to reproduce the mentioned issue on Drupal 11.x with Standard and Umami; but unable to reproduce the issue, Drover does not close when moving for submenus. Please let me know if I'm missing anything

    adding recording for the reference

  • ๐Ÿ‡ช๐Ÿ‡ธSpain ckrina Barcelona

    ckrina โ†’ changed the visibility of the branch 3437401-drawer-closes-when to hidden.

  • ๐Ÿ‡ท๐Ÿ‡ธSerbia finnsky

    @Kanchan Bhogade thank you for review! Could you please retest in current 1.x
    In your video i see pretty outdated things.

  • Status changed to Needs work 8 months ago
  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland lauriii Finland
  • ๐Ÿ‡ช๐Ÿ‡ธSpain ckrina Barcelona

    This is actually implementing the strategy of a delay, which is what I mentioned to try to avoid :)

    Implement a solution that doesn't add extra reaction time but that improves the current interaction.

    If you want to go initially for beta this week with the delay it's OK because we're making it look smoother, but let's open another issue for that (plus the other JS polishing that you might want to do). The final solution though should follow the strategy that "predicts the mouse movement".

    That's why I pasted links to libraries and strategies that have found a solution already without implementing a delay:

  • ๐Ÿ‡ท๐Ÿ‡ธSerbia finnsky

    Gonna try one more thing here.

  • Pipeline finished with Success
    8 months ago
    Total: 211s
    #135140
  • Status changed to Needs review 8 months ago
  • ๐Ÿ‡ท๐Ÿ‡ธSerbia finnsky

    Pushed with green debug path displays that safe polygons.

  • Pipeline finished with Success
    8 months ago
    Total: 233s
    #135603
  • Pipeline finished with Success
    8 months ago
    #135918
  • ๐Ÿ‡ท๐Ÿ‡ธSerbia finnsky

    Removed green lines and fixed end point

    https://sparkling-gaufre-c402f2.netlify.app/iframe.html?args=&id=page--b... for debug info

  • Pipeline finished with Success
    8 months ago
    #135933
  • Pipeline finished with Success
    8 months ago
    Total: 219s
    #136131
  • Pipeline finished with Success
    8 months ago
    Total: 258s
    #136143
  • Pipeline finished with Success
    8 months ago
    Total: 275s
    #136245
  • Pipeline finished with Success
    8 months ago
    Total: 237s
    #136252
  • Status changed to Fixed 8 months ago
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance nod_ Lille
  • ๐Ÿ‡ช๐Ÿ‡ธSpain ckrina Barcelona

    Merging this! Let's follow-up with the small things found and discussed in Slack this past days in other issues so this improvement can unblock the beta release Thanks for all the great and fast work here, @finnsky!!

  • Pipeline finished with Success
    8 months ago
    Total: 211s
    #136276
  • Automatically closed - issue fixed for 2 weeks with no activity.

  • Pipeline finished with Success
    6 months ago
    Total: 210s
    #197890
  • Pipeline finished with Failed
    3 months ago
    Total: 438s
    #267945
  • Pipeline finished with Failed
    3 months ago
    Total: 382s
    #267954
  • Pipeline finished with Failed
    3 months ago
    Total: 445s
    #285357
  • Pipeline finished with Failed
    3 months ago
    Total: 676s
    #285376
  • Pipeline finished with Failed
    3 months ago
    Total: 494s
    #285417
  • Pipeline finished with Failed
    3 months ago
    Total: 442s
    #285507
  • Pipeline finished with Failed
    3 months ago
    Total: 419s
    #286123
  • Pipeline finished with Failed
    3 months ago
    Total: 437s
    #286128
  • Pipeline finished with Failed
    3 months ago
    Total: 460s
    #286138
  • Pipeline finished with Success
    3 months ago
    Total: 2802s
    #286168
  • Pipeline finished with Success
    3 months ago
    Total: 454s
    #287212
  • Pipeline finished with Failed
    2 months ago
    Total: 459s
    #287990
  • Pipeline finished with Failed
    2 months ago
    Total: 432s
    #288058
  • Pipeline finished with Failed
    2 months ago
    Total: 451s
    #288069
  • Pipeline finished with Success
    2 months ago
    #288079
  • Pipeline finished with Failed
    2 months ago
    Total: 283s
    #289703
  • Pipeline finished with Success
    2 months ago
    Total: 330s
    #290321
  • Pipeline finished with Success
    about 1 month ago
    Total: 199s
    #320411
  • Pipeline finished with Failed
    about 1 month ago
    Total: 205s
    #320420
  • Pipeline finished with Success
    about 1 month ago
    Total: 264s
    #320442
  • Pipeline finished with Success
    27 days ago
    #331221
  • Pipeline finished with Success
    26 days ago
    Total: 146s
    #331736
  • Pipeline finished with Success
    26 days ago
    Total: 140s
    #331762
  • Pipeline finished with Skipped
    12 days ago
    #345906
Production build 0.71.5 2024