Reputation: 1934
I would like to use the angular material mat-select
component without the mat-form-field
, I want it to be conceptually similar to the native select element. Is there a way to achieve that?
Upvotes: 3
Views: 6475
Reputation: 1934
A simple approach is to use a mat-menu
and update the trigger on button-click.
demo using mat-menu component.
If you don't want to use a menu but a mat-select
, here is a solution which uses the select component and also ensures the panel is positioned properly when opened:
demo using mat-select component
select
in a button
component.select
opacity 0 so it's not seen.open()
method on button click
.Upvotes: 6