Closed DerrikMilligan closed 10 months ago
Thanks for this PR @DerrikMilligan. Checking what you say and playing around in the codebase, I did the fix and added the return-values
prop to w-checkboxes (all related commits referenced here).
Released in version 3.7.0
Let me know if this is not completely addressing the original issue :)
It would be nice if we also had this functionality on the w-checkbox
itself. The w-checkboxes
already works well using v-model
on it with an array.
Hey @DerrikMilligan, this is indeed working with both w-checkbox and w-checkboxes now. Running your Codepen as is with the latest Wave UI will now return the return values
Oh dang! I missed that you had two different commits! One for each! Thanks so much! You're awesome!
Yeah, I had a typo in my commit message referencing this PR. now corrected :p
Currently we have the neat prop
return-value
on thew-checkbox
but we don't actually use it to return values.Here is a codepen of the issue. Note that the array only has true/false.
This still isn't perfect. With this setup we will get the correct value emitted but we can't actually just pass an array in the
v-model
like the Vue documentation shows. I'm guessing that's because there's some additional magic happening on aninput
withv-model
.One other option we could look at using is true-value and false-value that Vue supports on the input type checkbox by default. We may also need to hook into the input's actual
v-model
for these to work. We should be able to just pass along ourmodelValue
for that. Wanted to see what you thought of this idea @antoniandre before I went for a larger set of changes.