Material-components-web: Select menu does not close when clicking

Created on 12 Dec 2017  路  6Comments  路  Source: material-components/material-components-web

Bugs

What MDC-Web Version are you using?

0.27.0

What browser(s) is this bug affecting?

Crome 62.0.3202.94 and any browser

What OS are you using?

Windows 10

What are the steps to reproduce the bug?

  1. Go to https://codepen.io/YuoMamoru/full/rpNxMB
  2. Click a "mdc-select" in the page
  3. Click the list under "Steps to Reproduce the Bug"

What is the expected behavior?

If you click the point on "li" tag with class="mdc-list-item", the menu should close.

What is the actual behavior?

If you click the point on "li" tag with class="mdc-list-item", the menu does not close.

Any other information you believe would be useful?

I think that it is an issue not to check whether the element clicked is part of its own menu in handleDocumentClick_(evt) on mdc-menu/simple/foundation.js.

help wanted

All 6 comments

I have also noticed that the mdc-simple-menu won't close if you click on a mdc-list-item element somewhere else on the page, even if it isn't part of the simple-menu.

I've fixed this in #1756.
@KayvandenHeuvel @YuoMamoru Maybe you could try my patch?

The patch looks good to me.

Same issue over here in 0.29.0. Can't click on the titles in the mdc-simple-menu. If I click at the side it works. Looks like I'm using the same HTML as in the demo (there it works).

@jordyboytjuh I believe the issue is that menu item elements cannot be anything but text, no sub-elements. A fix is required

@jordyboytjuh @aaronhudon I think this should be fixed in #1756.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cintaccs picture cintaccs  路  3Comments

yapryntsev picture yapryntsev  路  3Comments

robzenn92 picture robzenn92  路  4Comments

broros picture broros  路  3Comments

abhiomkar picture abhiomkar  路  3Comments