Skip to content

Use select event instead f click in DropdownMenuItem demo #2105

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

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from

Conversation

1nVitr0
Copy link

@1nVitr0 1nVitr0 commented Aug 8, 2025

Since the example / demo is most often the place developers look first, it would make sense to use the exposed select event here, instead of a generic click event.

Originally I had planned to open an issue, because when using the click event, I had some strange behavior when selecting an item: Despite the menu closing, the pointer-events: none style was still applied to the bodyelement. Despite my best efforts, I was not able to create a minimal (not) working example. My best guess is some weird timing issues in the async functions I used. If I do manage to reproduce the behaviour, I will create an issue.

Short story is, when I used select instead of click, the pointer-events: none; was removed correctly, so maybe this will prevent others from running into the same issue. And, I do think regardless of a possible issue, documenting the select event does make more sense than the current @click.

@1nVitr0
Copy link
Author

1nVitr0 commented Aug 8, 2025

If anyone does come across the same issue I had, it was consistently "caused", essentially by changing an async function somewhere in the click callback tree from

async () => {
    // Do some stuff
    return true;
}

to

async () => {
    // Do the same stuff as above
    return await Promise.resolve(true);
}

Just by plugging that into the @click event callback didn't reproduce the issue, and I did not find any other special circumstances in my own code that could cause it. Will open a separate issue if I find out what exactly causes it

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

Successfully merging this pull request may close these issues.

1 participant