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

[joy-ui][Select] options stay open when clicking outside (Safari) #39026

Open
2 tasks done
sodenn opened this issue Sep 17, 2023 · 9 comments
Open
2 tasks done

[joy-ui][Select] options stay open when clicking outside (Safari) #39026

sodenn opened this issue Sep 17, 2023 · 9 comments
Assignees
Labels
bug 🐛 Something doesn't work component: select This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy

Comments

@sodenn
Copy link

sodenn commented Sep 17, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example: https://mui.com/joy-ui/react-select/#basic-usage

Steps:

  1. Open the example in Safari
  2. Click on the select to open the options list
  3. Click outside => the options list stays open

Current behavior 😯

The options list doesn't close when clicking outside. Only Safari is affected. Chrome works as expected.

Expected behavior 🤔

The options list should close when clicking outside the select.

Context 🔦

No response

Your environment 🌎

No response

@sodenn sodenn added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 17, 2023
@danilo-leal danilo-leal added bug 🐛 Something doesn't work component: select This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy labels Sep 18, 2023
@jyash97
Copy link
Contributor

jyash97 commented Sep 18, 2023

Hey @danilo-leal @siriwatknp 👋

Can I take a look at this issue ?

@siriwatknp
Copy link
Member

Hey @danilo-leal @siriwatknp 👋

Can I take a look at this issue ?

Sure!

@danilo-leal danilo-leal removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 20, 2023
@jyash97
Copy link
Contributor

jyash97 commented Sep 21, 2023

@siriwatknp I took a look at this issue, this seems to be more complicated than I thought, but I was able to find the root cause of it.

So when we click the button and menu opens the focus is not kept on button and hence when we click outside of the button the blur event responsible for closing the menu is never triggered. To note: this happens on mui-base as well since it uses a similar approach.

Any idea what can be causing this? Might need a little help to solve this, thanks :D

@sodenn
Copy link
Author

sodenn commented Oct 2, 2023

I cannot reproduce the issue with the latest version of Safari. I tested it in Safari 17.0 and macOS Sonoma 14.0, which was released last week.

@thecoder93
Copy link

Hi, with Safari 15.5 I can reproduce the issue. Later, I'll try with the new version of Safari.

@thecoder93
Copy link

I cannot reproduce the issue with the latest version of Safari. I tested it in Safari 17.0 and macOS Sonoma 14.0, which was released last week.

Yep, I tried with Safari 17.0 on Sonoma and I don't see any problem.

@phudtran
Copy link

I can reproduce on:

MacOS Ventura 13.4.1
Safari 16.5.1

@alexpuia
Copy link

I believe the reason behind this might be that "onClose" function actually gets called with "onBlur" instead of "blur" reason.

@trymoto
Copy link

trymoto commented Dec 27, 2023

If you're coming here from search - just update to the latest patch if mui / joy, it's been fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: select This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy
Projects
None yet
Development

No branches or pull requests

8 participants