-
Notifications
You must be signed in to change notification settings - Fork 152
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
Classes prop doesn't respond to changes when computed #126
Comments
Hey, just found out about this problem as well. Any chanes we can get this fixed? Otherwise it's pretty impossible to style the Multiselect for invalid/error state :/ |
Hey @timoransky, I'm going to try and work on a PR, though I'm not convinced it'll get merged. Not sure if this will help you, but to work around this at the moment I've place a wrapper around the <!-- Dropdown.vue -->
<template>
<div
:class="{
'sm:text-xs': size === 'sm',
'sm:text-sm': size === null,
'sm:text-lg': size === 'lg',
'border-gray-300': !isInvalid,
'border-red-300 text-red-900': isInvalid,
}"
class="relative border rounded-md shadow-sm"
>
<Multiselect />
</div>
</template>
<script>
export default {
props: ['size', 'isInvalid'],
// ...
}
</script> This can get tricky since you'll have to make sure the border radius in your |
Hey, thanks a lot! I did it in very similar way. |
Thanks for reporting @stevebauman - classes were indeed not reactive. This got fixed in |
Thanks @adamberecz! Really appreciate it 🙏 |
Version
Description
First off, thanks for the work on this! I really like this select component ❤️
When providing the
classes
prop as a computed property, multiselect doesn't apply the changes (i.e. is not reactive to the change).I'm struggling attempting to apply "invalid" styling to the element, since the component doesn't re-compute class name changes.
Demo
https://jsfiddle.net/phuqkv0b/
When changing
invalid
totrue
and re-running the fiddle, the text and container border is appropriately changed to red. However, changing it dynamically via a button (for example) does not update the classes and reflect the necessary class changes.The text was updated successfully, but these errors were encountered: