primefaces / primevue

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

FileUpload v4: PassThrough for button in basic mode differs from documentation #5705

Open sceee opened 6 months ago

sceee commented 6 months ago

Describe the bug

It is not possible to set the class attribute using passThrough for a FileUpload.

The class attribute is just not set when trying to set it via pt:choose-button:class="my-fancy-class".

EDIT: Actually in the code I saw that - when using basic mode - the pt is mapped to the property "pcButton" which translates to pt:button:class. So when using pt:button:class="my-fancy-class", it works as expected. However, this is not described in the passThrough docs. As I am not sure whether this should be fixed in code or in the docs, I am leaving this issue open.

Reproducer

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

PrimeVue version

4.0.0-beta.2

Vue version

3.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

Chrome 124.0.6367.119, Edge 124.0.2478.80

Steps to reproduce the behavior

  1. Create a FileUpload with a passThrough to set the class for the ChooseButton
    
    <script setup lang="ts"></script>

2. Check that the class is applied and visible in the DOM

### Expected behavior

The class `my-fancy-class` is applied to the button element in the dom with the class `p-fileupload-choose-button`.
sceee commented 1 month ago

@agas0077 see in my original issue above:

So when using pt:button:class="my-fancy-class", it works as expected.

agas0077 commented 1 month ago

yeah thanks, i somehow missed it while reading lol