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: Name attribute not applied when used outside of Form component #6737

Open
robm-masabi opened this issue Nov 6, 2024 · 1 comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@robm-masabi
Copy link

Describe the bug

When you use an InputText component outside of a Form component - note the capital F here - (e.g. inside a native <form> element or otherwise) and you apply a name attribute to that InputText component, then the name attribute is not rendered in the resulting markup.

This is a regression from previous versions of Primevue, and is not mentioned in any changelog. Therefore, I'm assuming its a bug.

Examples on the component's documentation feature the component being used outside of the <Form> parent (e.g. within a <div>), and do not indicate that certain fields will only render within a given context.

Since names are used for native form submission, the removal of this functionality is, I believe, a breaking change.

Reproducer

https://stackblitz.com/edit/nlblb9-7eepxq?file=src%2FApp.vue,package.json

PrimeVue version

4.2.0

Vue version

4.x

Language

TypeScript

Build / Runtime

Nuxt

Browser(s)

No response

Steps to reproduce the behavior

Add a name attribute to an InputText element.

View the resulting HTML rendered.

NB: This also affects other input types too - but InputText is the most widely used and easy to reproduce.

Expected behavior

The name attribute set on the InputText element should appear on the input element in the HTML, as described in the documenation.

e.g.

<InputText name="some-value" v-model="exampleRef" /> 

...should render....

<input name="some-value />
@robm-masabi robm-masabi added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 6, 2024
@Arsolitt
Copy link

+1 same

@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 Nov 14, 2024
@tugcekucukoglu tugcekucukoglu added this to the 4.3.0 milestone Nov 14, 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