Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

menu and FormControls #240

Closed
rapropos opened this issue Oct 3, 2017 · 7 comments
Closed

menu and FormControls #240

rapropos opened this issue Oct 3, 2017 · 7 comments

Comments

@rapropos
Copy link
Contributor

rapropos commented Oct 3, 2017

I wonder if it might be possible to somehow create some sort of alternative wrapping API for a menu toggle / menu combination that could be bound directly via either [(ngModel)] or to a FormControl without the need for having a dedicated opening method, @ViewChild to the menu, and a (select) handler in the controller?

@trimox
Copy link
Owner

trimox commented Oct 3, 2017

@rapropos Definitely.
If @Input property (below) is added, you could bind using [(ngModel)] or FormControl.

@Input('open') open_: boolean;

Is this what ya need?

@rapropos
Copy link
Contributor Author

rapropos commented Oct 3, 2017

I am thinking of something that would be a drop-in replacement for <select>, that would incorporate all the toggling as well.

@trimox
Copy link
Owner

trimox commented Oct 8, 2017

Just completed some significant infrastructure changes. Reviewing this request and will let ya know.

@trimox
Copy link
Owner

trimox commented Oct 22, 2017

Hey @rapropos
Just released MDC v0.5.4 and the MDC Select component. Does this include the functionality you're looking for?

@rapropos
Copy link
Contributor Author

rapropos commented Oct 23, 2017

I'm not seeing a section on it in the demo app, but I'll try to figure out how to use it from the source.

UPDATE: Yes, that seems to be working nicely. One small caveat: the menu I tested it on has only four items, and would not normally seem to necessitate a scrollbar for the menu, yet one appears. A cursory glance did not suggest if that is able to be controlled via a property.

@trimox
Copy link
Owner

trimox commented Oct 23, 2017

Awesome to hear 👍

Yeah, the scrollbar is related to upstream issue: material-components/material-components-web#1387. I also mentioned a concern regarding the change prior to the MDC release; material-components/material-components-web#1247, but it may have been overlooked.

Are you using @angular-mdc/theme for your application Sass import? I introduced a temporary fix until resolved upstream. https://github.com/trimox/angular-mdc-web/tree/master/src/theme/extend/mdc-menu
If the temporary fix is not working, please let me know.
-trimox

@rapropos
Copy link
Contributor Author

My @angular-mdc/theme was still on 0.0.3. After upgrading it to 0.0.4, I no longer see the scroll bar. Thanks for taking the time to implement this; I find it much easier to work with than dealing with the menu manually.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants