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

[Select] Select menu can't be closed by clicking away #8

Open
homerchen19 opened this issue Feb 19, 2024 · 2 comments
Open

[Select] Select menu can't be closed by clicking away #8

homerchen19 opened this issue Feb 19, 2024 · 2 comments
Assignees
Labels
bug 🐛 Something doesn't work component: select This is the name of the generic UI component, not the React module!

Comments

@homerchen19
Copy link

homerchen19 commented Feb 19, 2024

Steps to reproduce

Link to live example: https://mui.com/base-ui/react-select/#introduction

Steps:

  1. Add value="" to the <Select> component

Screenshot 2024-02-19 at 13 36 06

Current behavior

  • The Select menu can't be closed by clicking away if its value prop doesn't match any option's value
  • Selecting an option can close the menu though

Expected behavior

  • The Select menu can be closed by clicking away even if its value prop doesn't match any option's value

Context

No response

Your environment

"@mui/base": "5.0.0-beta.36"

Search keywords: Select

@homerchen19 homerchen19 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 19, 2024
@mj12albert
Copy link
Member

@homerchen19 Thanks for reporting this - I thought it may be because you set both defaultValue and value in your screenshot, but I can reproduce it with an out of range value (no defaultValue)

Just for comparison: clickaway works correctly with an out of range value in Material UI's Select (demo)

<Select value="abc" label="Age">
  <MenuItem value={10}>Ten</MenuItem>
  <MenuItem value={20}>Twenty</MenuItem>
</Select>

@mj12albert mj12albert assigned michaldudak and unassigned mj12albert Feb 20, 2024
@mj12albert mj12albert removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 20, 2024
@homerchen19
Copy link
Author

JFYI, I noticed this bug after installing version "5.0.0-beta.29" which contains this PR

@michaldudak michaldudak transferred this issue from mui/material-ui Feb 27, 2024
@michaldudak michaldudak changed the title [base-ui][Select] Select menu can't be closed by clicking away [Select] Select menu can't be closed by clicking away Feb 27, 2024
@michaldudak michaldudak added component: select This is the name of the generic UI component, not the React module! bug 🐛 Something doesn't work labels Feb 27, 2024
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!
Projects
None yet
Development

No branches or pull requests

3 participants