material-components / material-components/material-web
select: clicking the main container doesn't close the menu
Nobody has claimed this yet.
- Dominant language
- SCSS
- Stars
- 11.3k
- Forks
- 1.1k
- Avg merge
- 20h 28m
- Merged PRs (30d)
- 13
Description
### What is affected?
Component
### Description
First click on the main body opens the menu for a choice as expected,
but clicking the main body again (with the intention of cancellation) is not closing the menu.
### Reproduction
[PLAYGROUND](https://lit.dev/playground/#project=W3sibmFtZSI6Im1hdGVyaWFsLWltcG9ydHMuanMiLCJjb250ZW50IjoiaW1wb3J0IFwiQG1hdGVyaWFsL3dlYi9zZWxlY3Qvb3V0bGluZWQtc2VsZWN0LmpzXCI7XG5pbXBvcnQgXCJAbWF0ZXJpYWwvd2ViL3NlbGVjdC9zZWxlY3Qtb3B0aW9uLmpzXCI7In0seyJuYW1lIjoiaW5kZXguaHRtbCIsImNvbnRlbnQiOiI8IURPQ1RZUEUgaHRtbD5cbjxzY3JpcHQgdHlwZT1cIm1vZHVsZVwiIHNyYz1cIi4vbWF0ZXJpYWwtaW1wb3J0cy5qc1wiPjwvc2NyaXB0PlxuXG48bWQtb3V0bGluZWQtc2VsZWN0PlxuICA8bWQtc2VsZWN0LW9wdGlvbiBhcmlhLWxhYmVsPVwiYmxhbmtcIj48L21kLXNlbGVjdC1vcHRpb24-XG4gIDxtZC1zZWxlY3Qtb3B0aW9uIHNlbGVjdGVkIHZhbHVlPVwiYXBwbGVcIj5cbiAgICA8ZGl2IHNsb3Q9XCJoZWFkbGluZVwiPkFwcGxlPC9kaXY-XG4gIDwvbWQtc2VsZWN0LW9wdGlvbj5cbiAgPG1kLXNlbGVjdC1vcHRpb24gdmFsdWU9XCJhcHJpY290XCI-XG4gICAgPGRpdiBzbG90PVwiaGVhZGxpbmVcIj5BcHJpY290PC9kaXY-XG4gIDwvbWQtc2VsZWN0LW9wdGlvbj5cbjwvbWQtb3V0bGluZWQtc2VsZWN0PiJ9LHsibmFtZSI6InBhY2thZ2UuanNvbiIsImNvbnRlbnQiOiJ7XG4gIFwiZGVwZW5kZW5jaWVzXCI6IHtcbiAgICBcImxpdFwiOiBcIl4yLjAuMFwiLFxuICAgIFwiQGxpdC9yZWFjdGl2ZS1lbGVtZW50XCI6IFwiXjEuMC4wXCIsXG4gICAgXCJsaXQtZWxlbWVudFwiOiBcIl4zLjAuMFwiLFxuICAgIFwibGl0LWh0bWxcIjogXCJeMi4wLjBcIlxuICB9XG59IiwiaGlkZGVuIjp0cnVlfV0)
### Workaround
a click event listener can be used to manually close the menu when it's opened
### Is this a regression?
No or unsure. This never worked, or I haven't tried before.
### Affected versions
1.0.1
### Browser/OS/Node environment
Everywhere
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the behavior using the linked playground, starting with the md-outlined-select and md-select-option imports in material-imports.js and index.html. Trace the select component's click handling and identify the existing behavior around reopening an open menu. Done means clicking the main container a second time closes the menu, with a regression check covering that interaction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100