Skip to content

[Bug]: Form Not Reset If setValue() Was Used for Input Widgets #30482

Open
@ame-appsmith

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

  1. Add a Form widget to the canvas.
  2. Add an Input widget inside the Form widget.
  3. 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.
  4. Click the button to set the value of the input.
  5. Click Reset and note that the input does not get cleared.
  6. 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.
  7. Type some text in the input and click Reset. Note that the input is set back to the value set with the setter.
  8. 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

Front logo Front conversations

Metadata

Labels

BugSomething isn't workingCommunity Reportedissues reported by community membersIntegrations Pod GeneralIssues related to the Integrations Pod that don't fit into other tags.Integrations ProductIssues related to a specific integrationJavascript ProductIssues related to users writing javascript in appsmithMediumIssues that frustrate users due to poor UXNeeds TriagingNeeds attention from maintainers to triageProductionQuery & JS PodIssues related to the query & JS PodWidget setter methodIssues with widget property settersneeds estimateaccording to https://bit.ly/3JNaYTh

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions