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

InputMask: v4 no classes are passed to target inpud component #5908

Closed
mzuccaroli opened this issue Jun 17, 2024 · 3 comments
Closed

InputMask: v4 no classes are passed to target inpud component #5908

mzuccaroli opened this issue Jun 17, 2024 · 3 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@mzuccaroli
Copy link

Describe the bug

class attribute of the component is not passed to target input like other primevue components

example:
<InputMask class="w-full my-class" unstyled type="text" :disabled="authStore.isLoading" mask="999-999-999" />
does not pass the classess "w-full" and "my-class" to generated input element

Reproducer

https://stackblitz.com/

PrimeVue version

4.0.0-rc.2

Vue version

3.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

No response

Steps to reproduce the behavior

<InputMask class="w-full my-class" unstyled type="text" :disabled="authStore.isLoading" mask="999-999-999" />
does not pass the classess "w-full" and "my-class" to generated input element

Expected behavior

generated input element should have the "w-full" and "my-class" classes

@mzuccaroli mzuccaroli added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jun 17, 2024
@blevinelrp
Copy link

InputMask wraps InputText.
You need to use a passthrough to add classes to internal dom elements.
For example:

        <InputMask id="basic" v-model="value" mask="99-999999" placeholder="99-999999"
        :pt="{
            root: {
              root: {class: 'w-100 my-custom'}
            }
          }"
        />

@mzuccaroli
Copy link
Author

ok but in v3 you can easily use class without passthrough, it's a quite breaking change

@blevinelrp
Copy link

blevinelrp commented Jun 17, 2024

Breaking changes are one of the main reasons for major version updates (i.e. v3 to v4). That seems reasonable to me.

Also, being more explicit about which DOM element receives the passthrough seems like the correct choice. For example, what if you wanted to apply the class to the div that wraps the input, but not the input itself? There should be some way of specifying either.

@tugcekucukoglu tugcekucukoglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jun 26, 2024
@tugcekucukoglu tugcekucukoglu added this to the 4.0.0-rc.3 milestone Jun 26, 2024
@tugcekucukoglu tugcekucukoglu self-assigned this Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

3 participants