primefaces / primevue

Next Generation Vue UI Component Library
https://primevue.org
MIT License
8.8k stars 1.09k forks source link

InputNumber PrimeVue v4: passthrough for "input" ignored #5528

Open micvm opened 3 months ago

micvm commented 3 months ago

Describe the bug

In primevue version 4, passthrough attributes for the input segment (e.g. class or style) are ignored even if the documentation says this is supported. For root it works as expected.

Reproducer

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

PrimeVue version

4.0.0-beta.1

Vue version

3.x

Language

TypeScript

Build / Runtime

TypeScript

Browser(s)

No response

Steps to reproduce the behavior

  1. Include in your template an InputNumber component
  2. Set, for example, :pt="{ input: { style: 'width: 4rem', class: 'text-center' } }"
  3. The resulting DOM for the input of InputNumber does not contain any of the listed styles or classes.
  4. Do the same for root instead of input and you will see the div of the component having them.

Expected behavior

The resulting DOM should have under style and class the data inserted as passthrough option.

SagewLivingstone commented 3 months ago

Just ran into this issue myself, I had to do the following:

:pt="{ input: { root: { style: 'width: 4rem', class: 'text-center' } } }"

The documentation is not clear about this at all. I only figured this out by looking at how the presets were styling the component :/

micvm commented 3 months ago

Thanks for sharing this. Especially because it worked in the previous version and the documentation at https://v4.primevue.org/inputnumber/ seems to be the same as for v3.

vzakharov commented 1 month ago

Gosh, PrimeVue team seems to be just fond of adding breaking changes without even any documentation about them.

Tarabass commented 5 days ago

Thanks for sharing this. Especially because it worked in the previous version and the documentation at https://v4.primevue.org/inputnumber/ seems to be the same as for v3.

Doesn't work in v3.53.0 neither..