epicmaxco / vuestic-ui

Vuestic UI is an open-source Vue 3 component library designed for rapid development, easy maintenance, and high accessibility. Maintained by Epicmax (@epicmaxco).
https://vuestic.dev
MIT License
3.52k stars 341 forks source link

TimeInput filters don't work after build #1544

Closed Derranion closed 2 years ago

Derranion commented 2 years ago

Vuestic-ui version: 1.3.4

Steps to reproduce: Code sandbox example.

  1. Create a new project
  2. Add TimeInput there
  3. Add minutes or hours filter to this TimeInput

Code example:

  <va-time-input v-model="value" ampm :minutesFilter="(m) => m % 10 === 0" />
  <va-time-picker v-model="value" ampm :minutesFilter="(m) => m % 10 === 0" />

What is the expected behavior? Filters should apply to the TimeInput same way as it is applied to the TimePicker. In our case it should display only 10, 20, 30 ... minutes What is the current behavior? TimeInput filters work locally but do not work after the build using Vite or on codesandbox. (didn't test others) Other information Issue raised in our discord initially.

Derranion commented 2 years ago

Update: Any props that are passed from TimeInput to TimePicker (it is used as a dropdown content inside of the TimeInput) are not working after build.

Derranion commented 2 years ago

It was caused by this line of code in the 1.3.4 version: const timePickerProps = computed(() => filterComponentProps(props, extractComponentProps(VaTimePicker)))

The reason behind it was in wrapping already existed computed by the second one: vueUnpacksOnlyOneComputedByValue

Vue wasn't able to parse this properly and rolled back to default values.

I've checked it using new Vite project and new build of recently updated Vuestic (dev branch) and it was fixed by random refactor already.

That's why it will be fixed after the new release, on-hold till 1.4.0 just to check it in the final version.

m0ksem commented 2 years ago

Can we close it, @Derranion?

Derranion commented 2 years ago

Yes, works as intended in 1.4.2, tested it using Vite build.