-
Notifications
You must be signed in to change notification settings - Fork 302
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
AdvancedSelect data-hs-select -- how to detect change/ input? #252
Comments
Hey @RSchmitzHH! Have the same issue, for some reason most components won't work well with the I'm using Qwik and this was the only method that worked, it should be the same with vue. But dynamic changes to select won't capture the change. |
@RSchmitzHH My use-case and setup is slightly different to yours. But, instead of...
Could you use?...
The latter works for me, whereas the former does not. Hope that helps! |
Hi @richt222 your idea was a good one, thank you so much! on('change', ...) detects if I select/ deselect option from the list. What it does not detect, however, is if you deselect options by clicking on their own small "x" in the tag list. (I mean the x directly beside the tag name, in the example from the docs beside the pre-selected "Christina".) Do you or does anyone have an idea which event I might listen to to detect deselections by x-clicks? Again, many thanks for your help (to the two of you!) |
Okay, I took inspiration from the two of you and finally got a working version which I will post below for reference and until there is a proper fix by the authors. Basic tricks
Many thank again @richt222 and @Bootstrap-Paradox and hope this code might help others until there is the heartly awaited fix :D |
Hey folks - thanks for sharing the workarounds, we've added to our docs the backlink for this issue in case it'll be useful others. https://preline.co/docs/frameworks-vuejs.html Cheers! |
@jahaganiev Does it make sense to emit a |
…g-close-click fixes #252 fire change event when the tag close icon is clicked and item is removed
Hi there!
I love your new AdvancedSelect, but, unfortunately, cannot get it working. Specifically, I have trouble getting the selected value and/ or detecting a change event.
What I want to build (see my try below):
Starting from your Advanced Select => Tags example, a select for several of a number of specialties (which are dynamically fetched from my api endpoint in fetchSpecialties*). The selected values shall be emitted with an 'input' emit.
It works fine if I remove the
data-hs-select='{...}'
, i.e., use a usual select multiple.[ * : To achieve that the selectable values in the Advanced Select are initialised by those fetched from my DB, I had to wrap the advanced select using a v-if="specialtiesFetched". I have removed this from the minimal example below. I also tried without and it seems not to be related to the issue. ]
What I tried (all included in my code snippet below as I tried them):
I am on preline/select v2.0.2.
Following #190 (comment), I have learnt that there shall be a v2.0.3 which addresses my issue (is that so?), but unfortunately cannot find it using npm i.
I would very much appreciate any help how to get the selected values out of this beautiful select! :)
Thank you very much!
The text was updated successfully, but these errors were encountered: