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

Form: reset not working, changed value not update input #6755

Open
vksee opened this issue Nov 9, 2024 · 3 comments · May be fixed by #6767
Open

Form: reset not working, changed value not update input #6755

vksee opened this issue Nov 9, 2024 · 3 comments · May be fixed by #6767
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@vksee
Copy link

vksee commented Nov 9, 2024

Describe the bug

PrimeVue Form reset not working.
On call $form.reset() form states correctly (reseted).
But not input value.

It also updates the states, but does not update the input:
$form.username.value = 'NEW VALUE'

dependencies
"dependencies": {
    // ...
    "@primevue/forms": "^4.2.1",
    "@primevue/themes": "^4.2.1",   
    "primevue": "^4.2.1",
    "vue": "^3.5.12",
    // ...
}

Reproducer

https://stackblitz.com/edit/eszbvm?file=src%2FApp.vue

PrimeVue version

4.2.1

Vue version

3.x

Language

ALL

Build / Runtime

Vite

Browser(s)

Chrome 130

Steps to reproduce the behavior

No response

Expected behavior

No response

@vksee vksee 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 9, 2024
@damuso
Copy link

damuso commented Nov 12, 2024

I have probably found workaround using :value="$form.username.value" on a form input component. However I am not really sure if this is the right approach and if it does not bring more bugs

@damuso
Copy link

damuso commented Nov 12, 2024

I created PR which may resolve this issue

@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 13, 2024
@tugcekucukoglu tugcekucukoglu added this to the 4.2.2 milestone Nov 13, 2024
@tugcekucukoglu tugcekucukoglu modified the milestones: 4.2.2, 4.2.3 Nov 14, 2024
@tugcekucukoglu tugcekucukoglu modified the milestones: 4.2.3, 4.2.4 Nov 22, 2024
@mertsincan mertsincan modified the milestones: 4.2.4, 4.3.0 Nov 26, 2024
@bandif
Copy link

bandif commented Dec 12, 2024

Hey, I have noticed, that the reset also triggers validation probably because of "validateOnValueUpdate" being true. Would it be possible to prevent that? This problem appears in the example posted above, where if you click on Reset: $form.reset() the inline validation "Username is required." pops up. Interestingly if you click it again, the form is really reset to initial values. That state would be in my opinion the expected outcome.

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
Status: No status
Development

Successfully merging a pull request may close this issue.

5 participants