formio / formio.js

JavaScript powered Forms with JSON Form Builder
https://formio.github.io/formio.js
MIT License
1.87k stars 1.06k forks source link

FIO-7775: reset value event resets component values to their default values #5661

Closed ZenMasterJacob20011 closed 3 months ago

ZenMasterJacob20011 commented 3 months ago

Link to Jira Ticket

https://formio.atlassian.net/browse/FIO-7775

Description

Previously, formio.js reset value event would reset all components values to an empty value. This PR replaces this behavior by setting the value to the components default value, else if the component does not have a default value fall back to the empty value.

Why have you chosen this solution?

Although there were many potential solutions my solution was best because it allows all components to reset their values to the default value and will fallback to empty value if the component has no default value

Dependencies

N/A

How has this PR been tested?

I added automated tests and manually tested

Checklist: