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

InputText and Textarea duplicating custom class(es) in DOM element #2522

Closed
mrt-prodz opened this issue May 4, 2022 · 1 comment
Closed
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@mrt-prodz
Copy link

mrt-prodz commented May 4, 2022

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primevue/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=110

CodeSandbox Case (Bug Reports)
https://codesandbox.io/s/beautiful-pond-wy082c

Current behavior
Element has duplicated custom class name(s).

Expected behavior
Element should assign custom class name(s) only once.

Minimal reproduction of the problem with instructions
Add an InputText, InputNumber or Textarea with a custom class to your project then inspect the element in a browser, the input element has your custom class(es) twice.

Same issue could be observed in PrimeVue documentation, for example : https://www.primefaces.org/primevue/inputtext
Inspect the input for the Invalid example of an InputText, the class p-invalid will be assigned twice to the input element.

  • Vue version: 3.2.31

  • PrimeVue version: 3.12.2

  • Browser: Chrome 101.0.4951.41 | Firefox 94

@mrt-prodz mrt-prodz changed the title InputText, InputNumber, Textarea duplicating cusom class(es) in DOM element InputText, InputNumber, Textarea duplicating custom class(es) in DOM element May 4, 2022
@tugcekucukoglu tugcekucukoglu added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label May 5, 2022
@mb-mysterdev
Copy link

Hello,

I have cloned the project :
https://github.com/primefaces/primevue.git

I went in src/components/inputtext/InputText.vue and I added
inheritAttrs: false,

that fixed the inputtext and inputNumber Bug

For the textarea I did the same thing by patching
src/components/textarea/Textarea.vue
On export default i added :
inheritAttrs: false,

Now everything is working fine but I have to confirm with Primevue team if it doesn't have bad consequences.

Note: I checked and it does not affect the transmission of other attributes such as aria etc ...

Thanks for reporting the bug

@tugcekucukoglu tugcekucukoglu changed the title InputText, InputNumber, Textarea duplicating custom class(es) in DOM element InputText and Textarea duplicating custom class(es) in DOM element May 24, 2022
@tugcekucukoglu tugcekucukoglu added this to the 3.12.7 milestone May 24, 2022
@tugcekucukoglu tugcekucukoglu self-assigned this May 24, 2022
tugcekucukoglu added a commit that referenced this issue May 24, 2022
Fixed #2522 - InputText and Textarea duplicating custom class(es) in …
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