You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the use-case or motivation for changing an existing behavior?
Putting checkboxes in the menu for example
Which versions of Angular, Material, OS, browsers are affected?
All
Is there anything else we should know?
Reacted by Nathan, antonyRoberts, Randall Meeker, Dmitry A. Efimenko, Tim, Christopher Cadieux, Russell Trafford, PradeepRaj, Maciej Pieńkowski, Andrei Podznoev and 9 more
I would like to utilize this feature to allow menu to take text inputs. Perhaps a new directive:
md-menu-dont-close
We could throw this on the md-menu-items that we don't want to close the menu. We will likely have some items that we wish would close the menu and others that we wouldn't. Such as a short login form with with a few inputs and a submit button. We don't want menu to close while we are trying to enter text into inputs, but we do want it to close after clicking submit.
Reacted by Robouste, antonyRoberts, Randall Meeker, Dmitry A. Efimenko, abhilash, Krzysztof Saja, Tristan BAVEREZ, MOTORIST, Ahmed H., Maciej Pieńkowski and 2 more
‘prevent-close' option, to turn off automatic menu close when clicking outside the menu `
Which isn't quite what we are looking for, but it's close and a good indication that similar features are being considered.
From what I've read of the source we just need to prevent click events on md-menu-items from propagating up to the menu. If anyone has some pro tips before I get started I'm happy to hear them. I'll try to put together a splunkr over the weekend and submit a PR once it's working.
@RobousteHere's an ugly workaround. I'll turn it into a directive soon and update. For some reason using this with md-menu-item keeps menu open but doesn't allow inputs or checkboxes to register clicks or become focused. Take out the md-menu-item directive and everything works fine, just doesn't look quite as nice.
Reacted by Brian Troncone, Dmitry A. Efimenko, Tom and Minso
I have an input in my menu and this worked find <input class="input-log" (click)="$event.stopPropagation()" type="text" />
Reacted by Anand Kacha, Ashwin Shetty, jagcolombat, Krzysztof Saja, Khalav, Jonathan Raymer, Santosh Cheler, James Bromwell, Jarek Szczepanski, FlacosFlace and 34 more
Reacted by Nil Panés Coll, Fermín Ares, Krzysztof Saja, Santosh Cheler, James Bromwell, Clint Buhs, Sasá Rafalsky, Jose Gomes, Moshe Quantz, Tommy Gaessler and 5 more
Reacted by temyrrian-dev, Kristy Mae Almuete, ewaschenko, Levi Barker, Nick Tobolski, Patrick, Bruno Echenique Campanhã, Hasan-git, crmue and khushbu
Being able to turn this off would be great. We implemented a menu very similar to the google inbox account menu and ran into this issue. We had to add a click handler and stopPropagation on the entire menu.
Chatted w/ @kara about this and we decided that we don't want to add this as a feature to md-menu. This is largely because turning it on would be detrimental to the a11y experience (see https://www.w3.org/TR/wai-aria-practices-1.1/#menu), and we want to generally avoid adding APIs that go counter to a11y best practices.
Reacted by ygopensource
Reacted by mikila85, Aleš, Joseph Brasch, Miru, Jurch29, Nick Tobolski, DevDmitriy, jpercyetech, Rafael (lrdev), Aamir Shah and 5 more
For those who are waiting for this to be merged, this is how i did it to implement a multi-select columns in a table (i didnt want the input part of select).
I basically removed the md-menu-item directive and used the class mat-menu-item for the styling.
Reacted by Mark Siadat, Marc Neumann, Stepan, Adrián de la Rosa, Michael Krone, Josh Turmel, John, Tommy Gaessler, Praneet Loke, Luis Canales and 12 more
Reacted by John, Tommy Gaessler, Tejasvini-Bannai, Sofiène Djebali and Mahendar
Reacted by Mahendar
Reacted by Tommy Gaessler, Sofiène Djebali, Mahendar, Gopalakrishnan and Nurzhan Mukhamedkali
@jelbourn@kara
Dont know what you guys talking about.. ("This is largely because turning it on would be detrimental to the a11y experience") a11yproject.com -> Menu->Dropdown
Sends you here: Codepen Codepen2
Clearly shows when clicking on the menu it doesn't close.
If so many people ask for it, probably needed and will help the users.
Please reconsider and dont c**k-block your ecosystem PLZ 🥇
<3
Reacted by Joseph Brasch, Zeeshan Iqbal, FrancisS, Nick Tobolski, LosD, Spongeroberto and Nick Halanov
Reacted by Levi Barker, Miru, HEMANG THANKI, Bojan Kogoj, Samarasimhareddy Kommireddy, Mark, ygopensource, dmsch, Nurzhan Mukhamedkali and Ahmed Nour Jamal El-Din
turning it on would be detrimental to the a11y experience
And the irony is, blocking it from being used is detrimental to everyone's experience. Devs, and users included. I don't even know why this a11y thing is taking precedence over common sense, and established UI standards.
The only reason I'm even posting in this issue is that the angular material library has failed to provide some sort of popover component that animates from the button that was clicked, or instead opens as a full-screen overlay on narrow screens. Such a fundamental component that's been around on mobile and web forever (easily achievable on the Android and iOS SDK), which would utilise your existing components in a pretty simple way. I used to have md-panel at least:
But currently, I have to either twist a mat-menu to meet my needs, to use a dialog which also gives me no control over where it animates from. And what I'm making is totally fine from an accessibility standpoint...
angular-automatic-lock-bot commented on Sep 10, 2019
Activity
[-]MdMenu : keep menu open on click[/-][+]MdMenu : keep menu open on item click[/+]nayfin commentedon Feb 1, 2017
I would like to utilize this feature to allow menu to take text inputs. Perhaps a new directive:
md-menu-dont-closeWe could throw this on the
md-menu-itemsthat we don't want to close the menu. We will likely have some items that we wish would close the menu and others that we wouldn't. Such as a short login form with with a few inputs and a submit button. We don't want menu to close while we are trying to enter text into inputs, but we do want it to close after clicking submit.nayfin commentedon Feb 2, 2017
I just found this in the ReadMe:
`Not yet implemented
Which isn't quite what we are looking for, but it's close and a good indication that similar features are being considered.
From what I've read of the source we just need to prevent click events on
md-menu-itemsfrom propagating up to the menu. If anyone has some pro tips before I get started I'm happy to hear them. I'll try to put together a splunkr over the weekend and submit a PR once it's working.nayfin commentedon Feb 3, 2017
@Robouste Here's an ugly workaround. I'll turn it into a directive soon and update. For some reason using this with
md-menu-itemkeeps menu open but doesn't allow inputs or checkboxes to register clicks or become focused. Take out themd-menu-itemdirective and everything works fine, just doesn't look quite as nice.Robouste commentedon Feb 3, 2017
@nayfin Thank you, it seems to do the trick. But I choose the bootstrap dropdown, more customizable (for now !)
randallmeeker commentedon Feb 15, 2017
I have an input in my menu and this worked find
<input class="input-log" (click)="$event.stopPropagation()" type="text" />ccadieux commentedon May 29, 2017
Being able to turn this off would be great. We implemented a menu very similar to the google inbox account menu and ran into this issue. We had to add a click handler and stopPropagation on the entire menu.
jelbourn commentedon May 30, 2017
Chatted w/ @kara about this and we decided that we don't want to add this as a feature to md-menu. This is largely because turning it on would be detrimental to the a11y experience (see https://www.w3.org/TR/wai-aria-practices-1.1/#menu), and we want to generally avoid adding APIs that go counter to a11y best practices.
hghammoud commentedon Sep 14, 2017
For those who are waiting for this to be merged, this is how i did it to implement a multi-select columns in a table (i didnt want the input part of select).
I basically removed the md-menu-item directive and used the class mat-menu-item for the styling.
Hope this helps.
mikila85 commentedon Mar 6, 2018
@jelbourn @kara
Dont know what you guys talking about.. ("This is largely because turning it on would be detrimental to the a11y experience")
a11yproject.com -> Menu->Dropdown
Sends you here:
Codepen
Codepen2
Clearly shows when clicking on the menu it doesn't close.
If so many people ask for it, probably needed and will help the users.
Please reconsider and dont c**k-block your ecosystem PLZ 🥇
<3
sarbull commentedon Mar 29, 2018
source: https://stackoverflow.com/a/41001184/1527666
jpike88 commentedon Jun 3, 2019
And the irony is, blocking it from being used is detrimental to everyone's experience. Devs, and users included. I don't even know why this a11y thing is taking precedence over common sense, and established UI standards.
The only reason I'm even posting in this issue is that the angular material library has failed to provide some sort of popover component that animates from the button that was clicked, or instead opens as a full-screen overlay on narrow screens. Such a fundamental component that's been around on mobile and web forever (easily achievable on the Android and iOS SDK), which would utilise your existing components in a pretty simple way. I used to have md-panel at least:
https://material.angularjs.org/1.1.1/api/type/MdPanelPosition
But currently, I have to either twist a mat-menu to meet my needs, to use a dialog which also gives me no control over where it animates from. And what I'm making is totally fine from an accessibility standpoint...
angular-automatic-lock-bot commentedon Sep 10, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.