-
Notifications
You must be signed in to change notification settings - Fork 33
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
how to clear input box? #42
Comments
@ijunaid8989 Hi, thanks for the idea, I'll do it in the next hour and release a new version for you. |
yes Pleas that would be so wonderful to have. |
search string for input, you can use this with ".sync" modifier re #42
# [2.4.0](v2.3.0...v2.4.0) (2019-03-04) ### Features * **props:** added new prop "search-text" ([0782bbc](0782bbc)), closes [#42](#42)
# [2.4.0](v2.3.0...v2.4.0) (2019-03-04) ### Features * **props:** added new prop "search-text" ([0782bbc](0782bbc)), closes [#42](#42)
Thanks I see you have added few things. right now I am using it in this way
Now I can set the search to |
I'm testing a new system of realeases here, so there was a confusion with commits and PR. Soon I will inform you. |
that would be so great. Thanks a ton
Junaid Farooq
Software Developer - Evercam.io
…On Mon, 4 Mar 2019 at 19:24, Илья ***@***.***> wrote:
I'm testing a new system of realeases here, so there was a confusion with
commits and PR. Soon I will inform you.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#42 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AM7wjyXbr94gwtj6P_S-UO7VmE9eFoU0ks5vTSyjgaJpZM4bcPP_>
.
|
Released 2.4.0. Added new prop <cool-select
v-model="selected"
:items="items"
:search-text.sync="search"
/> Do not forget to have the Like this you can change the search string: <button
@click="search = ''"
>
Set search to ""
</button> Check if everything works. Should work. |
Stop it seems I forgot to do something. Excuse me, I tried to test the new system and it confused me. This should work in 2.4.1. |
Should I update now?
Junaid Farooq
Software Developer - Evercam.io
…On Mon, 4 Mar 2019 at 19:35, Илья ***@***.***> wrote:
Stop it seems I forgot to do something. Excuse me, I tried to test the new
system and it confused me. This should work in *2.4.1*.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#42 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AM7wj9PFo6R3jEmKA0IFgJQf-CcCXZKIks5vTS8cgaJpZM4bcPP_>
.
|
In version 2.4.1 everything should work. I checked it on the example of REST API, the code is similar to yours. Write if everything works for you. |
Okay I did this way
in
when I do |
Its not working I think, may be My code is not right |
I have tested it, Its only working through |
You have actually added it sync modifier so that's causing the issue I think. |
Everything should work in my example. You can not necessarily reset the search through You can create a method methods: {
resetSearch () {
this.search = ''
}
} And then I know that If my example does not really work for you, then I will make for you a example on codesanbox. |
Actually, I have tried through method, and It's not working at all, I also tried with the method in your AJAX code sandbox example. I only work @click='search =''' this way. |
Actually, its working if I set anything but I have tried , this.search = "test", these all work but then they dont let me enter anything again. also there is no place holder left. |
# [2.5.0](v2.4.2...v2.5.0) (2019-03-05) ### Features * **event emitter:** parent -> vue-cool-select relation, and reset-search event ([b97baca](b97baca)), closes [#42](#42)
@ijunaid8989 I have released a new version 2.5.0 for you. Maybe my past code will work now. I also created an example, the result of which can be viewed on codesanbox. Sorry if you have a big problem with this, I tried to help as I could. |
I am so much thankful to you for making such changes so early. :) I am closing the issue, this is not working for me somehow. An issue I think is: I am in Bootstrap model. I have tried the same as you mentioned. This is my clear from
also
But still its not working for me :) |
This is really strange, I made an example in which it works. Did not you forget to transfer |
I have tried everything and the same as you have done but still, the issue is the same. |
actually, it's clearing. but the text I type not the one I selected. |
Little did not understand you. If you explain at least a little more, then maybe I can help, at least I will try. |
Okay, I have created an AJAX loading example. the very same you are getting data from an endpoint and the loading on typing. When I type something rubbish such as it gives no search results and when I close modal, the emitter is working and clearing the search text. Now I typed a clear work.. this gives me in the list, and Now I click on it.. I mean I select it with mouse, and now and now when I close model it dont get cleared. I think emitter is not working with AJAX load example |
@ijunaid8989 Did I understand correctly? You need to remove the selected item, then there will be no search string, no selected item, the input field will be empty. If you use <cool-select
v-model="selected"
:items="items"
/> then you can just do this: resetSearchAndSelected () {
// resets search
this.selectEventEmitter.emit('set-search', '')
// resets selected
this.selected = null
} I saw that you did this in your code, but then I don’t understand why it doesn’t work for you. I checked it myself and it works for me. Maybe something in your code that prevents the selected item from being removed. Or maybe you remove the item, but then put it back? You can check code of my working example: https://github.com/iliyaZelenko/vue-cool-select/blob/master/gh-pages-src/pages/dev/Example3.vue#L66 Perhaps a mistake due to the fact that you use a combination of props that do not work together for some reason, but it's hard for me to say. |
this is my whle code. can you point now? |
I have tried to make selected null before after as well. |
Thanks to your detailed description of the error, I understood the problem. This is fixed in The problem was that with an empty array of Finally, we completely solved this problem! 🎉 |
Yes thanks, it is working now. :) |
# [2.10.0](v2.9.0...v2.10.0) (2019-03-29) ### Bug Fixes * **component:** fix circular call for methods ([03053bd](03053bd)) * **component:** fix tab navigation ([a03694b](a03694b)), closes [#98](#98) * **component:** when you clear the elements, the selected element is not cleared ([b184378](b184378)), closes [#42](#42) ### Features * **props:** added inputForTextClass prop ([ddb2c32](ddb2c32)), closes [#90](#90) * **slots:** added 4 new slots for input ([3f892e0](3f892e0)), closes [#98](#98)
Hello, is there anyway around to fill the search box text with a backend request? I have this method. And I also know..
I have tried to set a value here as well. but It didn't get fill in input? |
Hi, I made an example for you, I hope this is what you need. |
thanks you are the best. |
# [2.4.0](iliyaZelenko/vue-cool-select@v2.3.0...v2.4.0) (2019-03-04) ### Features * **props:** added new prop "search-text" ([0782bbc](iliyaZelenko/vue-cool-select@0782bbc)), closes [#42](iliyaZelenko/vue-cool-select#42)
# [2.4.0](iliyaZelenko/vue-cool-select@v2.3.0...v2.4.0) (2019-03-04) ### Features * **props:** added new prop "search-text" ([0782bbc](iliyaZelenko/vue-cool-select@0782bbc)), closes [#42](iliyaZelenko/vue-cool-select#42)
# [2.5.0](iliyaZelenko/vue-cool-select@v2.4.2...v2.5.0) (2019-03-05) ### Features * **event emitter:** parent -> vue-cool-select relation, and reset-search event ([b97baca](iliyaZelenko/vue-cool-select@b97baca)), closes [#42](iliyaZelenko/vue-cool-select#42)
# [2.9.0](iliyaZelenko/vue-cool-select@v2.8.0...v2.9.0) (2019-03-17) ### Bug Fixes * **component:** when you clear the elements, the selected element is not cleared ([381ddcd](iliyaZelenko/vue-cool-select@381ddcd)), closes [#42](iliyaZelenko/vue-cool-select#42) ### Features * **props:** added inputForTextClass prop ([3be99d8](iliyaZelenko/vue-cool-select@3be99d8)), closes [#90](iliyaZelenko/vue-cool-select#90)
# [2.10.0](iliyaZelenko/vue-cool-select@v2.9.0...v2.10.0) (2019-03-29) ### Bug Fixes * **component:** fix circular call for methods ([03053bd](iliyaZelenko/vue-cool-select@03053bd)) * **component:** fix tab navigation ([a03694b](iliyaZelenko/vue-cool-select@a03694b)), closes [#98](iliyaZelenko/vue-cool-select#98) * **component:** when you clear the elements, the selected element is not cleared ([b184378](iliyaZelenko/vue-cool-select@b184378)), closes [#42](iliyaZelenko/vue-cool-select#42) ### Features * **props:** added inputForTextClass prop ([ddb2c32](iliyaZelenko/vue-cool-select@ddb2c32)), closes [#90](iliyaZelenko/vue-cool-select#90) * **slots:** added 4 new slots for input ([3f892e0](iliyaZelenko/vue-cool-select@3f892e0)), closes [#98](iliyaZelenko/vue-cool-select#98)
Thanks for this great tool.
How I can remove the selected values?
I am using ajax options and I can set selected to null again and items to [] but the entered text is always there even after setting these changes., How I can clear the text and only show the placeholder?
The text was updated successfully, but these errors were encountered: