threefoldtech / tfgrid-sdk-ts

Apache License 2.0
4 stars 8 forks source link

🐞 [Bug]: Reset function in Input and Form Validator not working #3341

Open amiraabouhadid opened 2 months ago

amiraabouhadid commented 2 months ago

Is there an existing issue for this?

which package/s did you face the problem with?

Dashboard

What happened?

I tried resetting a form using a const initialized with the useFormRef and then calling reset() on the const but the form was not reset back to Init status.

Steps To Reproduce

  1. create a form with form validator and input validator components
  2. disable submit btn until input is validated
  3. make input fields clear after form is submitted (i.e if string input set to "" after submit)
  4. use formRef.reset() and inputRef.reset().
  5. submit form
  6. watch validation get triggered after form is submitted

which network/s did you face the problem on?

Dev

version

current

Twin ID/s

No response

Node ID/s

No response

Farm ID/s

No response

Contract ID/s

No response

Relevant screenshots/screen records

image

Relevant log output

n/a
MohamedElmdary commented 2 months ago

Already working but added a tiny feature allowing user to add default value when reseting form/input here https://github.com/threefoldtech/tfgrid-sdk-ts/pull/3297