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
Allow to clear filter text value #41
Comments
I could open a PR for this |
Hi @andrea-spotsoftware, this should be easy to do. There is showClear() method in https://github.com/ng-select/ng-select/blob/master/src/lib/src/ng-select.component.html#L41 |
I think I have not explained well 😄 I was thinking about persisting selected item's display text in the html input field, making possible to select (for copy purpose) and delete it "manually", for example with keyboard backspace or canc, having the same effect of the cross button on the right. Probably the filter input text should be visible only when the select gets focus, because it would hide the custom label template. The plunker that i attached on the first message shows this behavior, if you select an item, it's clearable also with keyboard. |
Right, now I see what you mean. I don't like the idea of adding some background color for selected text like in kendo combobox, it looks ugly :) Let just make it this as simple as clearing model value on backspace(delete) button click, this will also work in multiselect case. To select text it may require to implement ctrl+a combination but this is separate task, lets focus on making clear functionality easer to use in this task. @andrea-spotsoftware Let me know if you want to take this, if not I can implement this. |
Hello @anjmao, i'm evaluating your component in a project that i'm working on.
It's almost perfect for my needs, but there is an issue that I found about the behavior of the input (that is actually empty) when an option item is selected.
In your opinion, it's hard to do something like this?
http://plnkr.co/edit/l3phEaaU2HyAiHlJcmwQ?p=preview
I'd like to have text selectable and clearable directly from the filter input.
The text was updated successfully, but these errors were encountered: