-
-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] On press ESC only empty search field #231
Comments
hi @nischi would you like to file a PR that implements this feature? ngx-mat-select-search/src/app/mat-select-search/mat-select-search.component.ts Lines 373 to 388 in bfcff8c
|
Will have a look into it. |
Since the search input is tied to a control, it seems easier to just implement yourself @nischi. Why not create your own listener that's active when you focus the search or even the full dropdown control? |
I tried this, but i can't stop the other listener on the Input, My listener will run after the other and so i can't stop bubbling. |
Oh, I understand. This may not be a problem with this module, rather with the native html dropdown interface. |
You got have a pull request :) |
It would be very nice to empty the search input with pressing "ESC". But it will close the Dropdown (also happen in your example). Maybe add an option to do this?
Please add an input which handle this feature. Ex. [emptySearchOnEsc]="false".
It could also be that the current behavior is a bug, but maybe some like it to close on ESC some like it to clear out the search box.
Alternative could be to clear out the input on ESC and if the input is empty and you click ESC it will close. So you have both.
I tried to stopPropagation of the event, but it seems that this component add an event handler on body, but didn't find anything in code.
The text was updated successfully, but these errors were encountered: