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
InputSwitch doesn't work since 3.47 #5234
Comments
Hi, Can you give a more details? Also, can you attach a sample stackblitz link for us? https://primevue.org/inputswitch/ it works fine for me. |
Hi, we have the same problem! We are using PrimeVue v3.50, with vite and vue3 into unstyled mode. The InputSwitch component is not working at all. Any idea?? |
As a workaround I use the click event to update a ref (in my case state from the pinia store). As I only use the switch ones I didn't write a wrapper around InputSwitch with a modelValue, but in the click you can also update a modelValue of the wrapper if you want to.. <script lang="ts" setup>
import InputSwitch from 'primevue/inputswitch'
const searchStore = useSearchStore()
const { sortOn } = storeToRefs(searchStore)
// TODO : Switch v-model is not working since primevue 3.47 or 3.48
// https://github.com/primefaces/primevue/issues/5234
const inputSwitch = ref<InstanceType<typeof InputSwitch> | null>(null)
const onClick = () => {
sortOn.value =
inputSwitch.value?.$props.modelValue === inputSwitch.value?.$props.falseValue
? inputSwitch.value?.$props.trueValue
: inputSwitch.value?.$props.falseValue
}
</script>
<template>
<PrimeInputSwitch
:model-value="sortOn"
@click="onClick"
true-value="afstand"
false-value="naam"
ref="inputSwitch"
/>
</template>
<style lang="scss" scoped></style> |
I'm facing the same issue. This is happening with the DataTable and its Pagination component as well. The InputSwitch is only displaying a checkbox when I upgrade to 3.50+, in 3.47 its the InputSwitch with a portion of a square displayed behind it, the input switch overlay is disabled always as well. The DataTable's display is off. It's almost like any/all styling was removed (everything is being displayed block instead of flex?). Any suggestions on how I could upgrade and resolve these issues? I'm having to remain at 3.46.0 for the time being. |
Looks like in this commit onClick handler was removed from InputSwitch, so it doesn't react to click. |
Could you share a stackblitz link? We cannot replicate the problem. |
I cannot make it work in Stackblitz with tailwind. https://stackblitz.com/edit/primevue-create-vue-issue-template-bajf2k?file=src%2FApp.vue |
Thanks for the clarification. Tailwind passthrough are not going to be maintained anymore and have already been removed for version 4. We could suggest using Tailwind presets: https://tailwind.primevue.org/builder/ |
This is not great to leave a component fully not functional when v4 hasn't been released. |
Describe the bug
It just stop working after update to 3.47 or 3.48.
If I rollback to 3.46, it works as expected
The text was updated successfully, but these errors were encountered: