Skip to content
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

Closed
johnluxor opened this issue Feb 7, 2024 · 13 comments
Closed

InputSwitch doesn't work since 3.47 #5234

johnluxor opened this issue Feb 7, 2024 · 13 comments
Labels
Resolution: Wontfix Issue will not be fixed due to technical limitations

Comments

@johnluxor
Copy link

johnluxor commented Feb 7, 2024

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

                    <InputSwitch v-model="form.use_bonus"
                                 class="ml-auto"
                                 :disabled="bonusSwitchDisabled"
                                 @update:model-value="toggleBonuses"
                    />```

### Reproducer

n/a

### PrimeVue version

3.47, 3.48

### Vue version

3.x

### Language

ES6

### Build / Runtime

Vite

### Browser(s)

N/A

### Steps to reproduce the behavior

N/A

### Expected behavior

It should work as expected
@johnluxor johnluxor added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 7, 2024
@mertsincan
Copy link
Member

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.

@mertsincan mertsincan added Resolution: Needs More Information More information about the issue is needed to find a correct solution and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Feb 9, 2024
@mertsincan mertsincan added this to the 3.52.0 milestone Feb 9, 2024
@Ky6uk
Copy link

Ky6uk commented Feb 12, 2024

It's probably related to other problems after upgrading to 3.47 and up. Almost all the components have been broken (styles) in case the custom styles used class names from the theming documentation. Some class names even went away completely in the minor release like some of these (.p-inputswitch-checked for example):

Screenshot 2024-02-12 at 10 22 38

Also, it looks like the default stylings have been changed also somehow.

@RMFogarty
Copy link

Same issue using 3.49 Input switch stopped working and has a strange visual issue with a black mark appearing under the top left side:

image

@Tarabass
Copy link

Tarabass commented Mar 4, 2024

image

@joseanzacarias
Copy link

Same problem here I'm using Nuxt 3 with tailwind, the input is not working at all.
image

@AlbertoInfogest
Copy link

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??

@Tarabass
Copy link

Tarabass commented Mar 21, 2024

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>

@MonkFox
Copy link

MonkFox commented Apr 11, 2024

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.

@johnluxor
Copy link
Author

Looks like in this commit

99b1edd

onClick handler was removed from InputSwitch, so it doesn't react to click.

@tugcekucukoglu
Copy link
Member

Could you share a stackblitz link? We cannot replicate the problem.

@johnluxor
Copy link
Author

I cannot make it work in Stackblitz with tailwind.
I use tailwind and tailwind paththrough. In Stackblitz it shows just checkbox and cannot find any classes Theme has.

https://stackblitz.com/edit/primevue-create-vue-issue-template-bajf2k?file=src%2FApp.vue

@tugcekucukoglu
Copy link
Member

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/

@tugcekucukoglu tugcekucukoglu removed this from the 3.52.0 milestone Apr 25, 2024
@tugcekucukoglu tugcekucukoglu added Resolution: Wontfix Issue will not be fixed due to technical limitations and removed Resolution: Needs More Information More information about the issue is needed to find a correct solution labels Apr 25, 2024
@RMFogarty
Copy link

This is not great to leave a component fully not functional when v4 hasn't been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Wontfix Issue will not be fixed due to technical limitations
Projects
None yet
Development

No branches or pull requests

9 participants