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

Context Selector: onSelect via click doesn't work when appended to document body #7104

Closed
thatblindgeye opened this issue Mar 21, 2022 · 0 comments · Fixed by #7165
Closed
Milestone

Comments

@thatblindgeye
Copy link
Contributor

Describe the issue. What is the expected and unexpected behavior?
From this comment in another issue #6824 (comment) :

Here I also append the dropdown menu to the document.body, but the first time we open the modal and toggle the dropdown menu, we cannot select the items in it. It looks like the click event happens on the body but not on the items so it will close the menu instead of selecting it. I believe this will also cause the same problem with the screen reader.

The expected behavior when clicking is to be the same when using keyboard, where clicking an option selects it rather than closing the dropdown and requiring needing to open and click the option again.

Please provide the steps to reproduce. Feel free to link CodeSandbox or another tool.

View the codesandbox in the issue comment linked above, or:

  • go to our Context Selector page and update the first example so that after line 82 there is the line:

    menuAppendTo={() => document.body}
  • click to open the dropdown and try clicking on the Action item, notice how the dropdown closes without actually selecting it

Is this a bug or enhancement? If this issue is a bug, is this issue blocking you or is there a work-around?
Bug

What is your product and what release version are you targeting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants