[Bug]: Form Not Reset If setValue() Was Used for Input Widgets #30482
Open
Description
Is there an existing issue for this?
- I have searched the existing issues
Description
If the value of the Input widgets of a Form widget was set by using the setValue()
method, the form does not get cleared when clicking the Reset button. If the Reset form on success property has been enabled, then it does not get reset when clicking the Submit button for this scenario either.
Moreover, after the input is set using the setter, if the user types something in the input and resets or submits the form, instead of being cleared, it gets reset to the value set with the setter.
Steps To Reproduce
- Add a Form widget to the canvas.
- Add an Input widget inside the Form widget.
- Add a button, and in its onClick event, run the
setValue()
method to set the value of the Input added in step Fix embedded datasource path #2. - Click the button to set the value of the input.
- Click Reset and note that the input does not get cleared.
- Ensure that the Reset form on success toggle is ON in the Submit button's properties and click the Submit button. The input does not get cleared either.
- Type some text in the input and click Reset. Note that the input is set back to the value set with the setter.
- Type some text in the input and click Submit. Note that the input is set back to the value set with the setter.
Public Sample App
https://app.appsmith.com/app/reset-form-when-using-setinput/page1-65aa8d6d344e1d591500fea0
Environment
Production
Issue video log
https://www.loom.com/share/56fde1712daf475589fc3ec03ae815c2
Version
v1.9.62
Metadata
Assignees
Labels
Something isn't workingissues reported by community membersIssues related to the Integrations Pod that don't fit into other tags.Issues related to a specific integrationIssues related to users writing javascript in appsmithIssues that frustrate users due to poor UXNeeds attention from maintainers to triageIssues related to the query & JS PodIssues with widget property settersaccording to https://bit.ly/3JNaYTh