Open fengmao opened 5 years ago
@fengmao you can use this approach https://stackblitz.com/edit/angular-5j9ujv?embed=1&file=app/autocomplete-overview-example.ts
@fengmao : were you bale to find a solution for this ?
This is work for me Thanks @swseverance
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.
Find more details about Angular's feature request process in our documentation.
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.
We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.
You can find more details about the feature request process in our documentation.
can we make autocomplete render inside cdkoverlay so that when selecting an option of autocomplete it doesn't run (overlayOutsideClick) output property of OVERLAY.
It's still relevant in v17 at least. I expected the MatAutocompleteSelectedEvent
to hold the source event with possibility to prevent default (closing the panel), but it does not.
I also would like to know how to keep autocomplete panel open after selected the option... I tried so many ways, it seems didn't work in autocomplete.
a workaround i came up with:
@for(option of options){
<mat-option>
<div class="wrapper" (click)="$event.stopPropagation(); yourOptionSelectHandler(option)">
....
</div>
</mat-option
}
Bug, feature request, or proposal:
this is a feature request
What is the expected behavior?
i want to keep autocomplete panel open when click outside the panel without select an option
What is the current behavior?
the panel is closed when click outside
What are the steps to reproduce?
https://stackblitz.com/angular/ynbmnnrjolq
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
i work with angular 7.x
Is there anything else we should know?