NO BUG: Different behavior of dropdown on mobile and desktop

Browser: Chrome 110
OS: macOS / Windows / Linux / etc.
URL: Link to a page that illustrates this issue
Video: Short screen recording that illustrates this issue (free tool: jam.dev)

Hello bricks team.

If we have an element in the dropdown content that displays a pop-up when clicked, from here on the behavior is different on desktop and mobile.

on the desktop

The dropdown content closes immediately after the popup appears. This is expected behavior.

on mobile

After the pop-up is displayed, the drop-down content is still displayed and not hidden like on the desktop. live link

Hi @jolia,

this is happening because on desktop, you are hovering with the mouse, and there are two events: mouseneter and mouseleave. After you click, the popup is opened and mouseleave event is registered because eventually, you are focusing on the popup, not on the dropdown anymore.

In contrast to mobile (touch device), when you click on the dropdown, it will register mouseenter, and then you click on the button that is still inside the dropdown, which means the “mouse” is still inside.
After that, the popup will open, and once you click somewhere, at that moment, the mouseleave will be detected because you will be clicking outside the dropdown.

There is no special logic for this in your end, and it’s all a default behaviour, so I’m unsure if we should do something regarding this or not.

Matej

Hi @Matej,

You’re right and completely understandable. I thought it might be possible to have the “Toggle on” control at different breakpoints.

1 Like

Then we agree to set it as NO BUG, at least for now. :slight_smile:

Thank you,
Matej

1 Like