Skip to content
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

Mobile View: Dropdown Menu Trigger First Element When clicking in the space between the trigger and the menu after closing the menu. #1037

Closed
Yehya22 opened this issue Jan 8, 2025 · 1 comment
Milestone

Comments

@Yehya22
Copy link

Yehya22 commented Jan 8, 2025

Description

On mobile view, clicking on the space between trigger and menu clicks on the first element after closing the menu, even with stopPropagation applied at multiple levels.

Expected behavior

Clicking on this space should only close the menu and not affect the first item of the dropdown menu.

Additional context

  • The issue seems to be specific to mobile views
  • I've tried adding stopPropagation at multiple levels:
    • On the dropdown trigger
    • On the dropdown content
    • On individual dropdown items
    • On the parent container
  • The issue persists despite these attempts
Screen.Recording.2025-01-08.at.3.08.33.PM.mov

Steps to Reproduce

  1. Open the demo in a mobile view.
  2. Click the ellipsis button to open the dropdown menu.
  3. Click on the space below the ellipsis button and dropdown menu.
  4. Observe that the checkmark changes to green after closing the menu.

Repository Link

Dropdown Component File

Logs

No response

System Info

- Bits UI version: 1.0.0-next.77
- Svelte version: 5.15.0
- Browser: Mobile browsers (Chrome, Safari)

Severity

annoyance

@Yehya22 Yehya22 changed the title Mobile View: Dropdown Menu Items Trigger First Element When clicking in the space between the trigger and the menu after closing the menu. Mobile View: Dropdown Menu Trigger First Element When clicking in the space between the trigger and the menu after closing the menu. Jan 8, 2025
@huntabyte huntabyte added bug Something isn't working PRIORITY: medium labels Jan 29, 2025
@huntabyte huntabyte added this to the 1.0 milestone Jan 29, 2025
@huntabyte huntabyte removed PRIORITY: medium bug Something isn't working labels Jan 29, 2025
@huntabyte
Copy link
Owner

In your video your touch cursor is still over the first menu item, so I'm unsure why it wouldn't make sense that it is triggering that. Touch cursors are larger than pointers because they typically align with the size of a finger. If you add more space between your trigger and the menu, you will get the desired behavior:

CleanShot.2025-01-30.at.18.39.00.mp4

I don't think this is really something we should address from a library perspective, because it would be going against the expectations.

Should this issue arise from others, perhaps we could reconsider.

@huntabyte huntabyte closed this as not planned Won't fix, can't repro, duplicate, stale Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants