AcroForm: Add support for ResetForm action

- it aims to fix #12721.
  - Thanks to PR #14023, we've now the fieldObjects in the annotation layer so we can easily map fields names on their id if needed.
  - Reset values in the storage, in the JS sandbox and in the visible html elements.
This commit is contained in:
Calixte Denizet 2021-09-26 21:04:11 +02:00
parent db7c91e7b1
commit aecbd7cd89
7 changed files with 302 additions and 15 deletions

View file

@ -79,6 +79,13 @@ class EventDispatcher {
baseEvent.actions,
baseEvent.pageNumber
);
} else if (id === "app" && baseEvent.name === "ResetForm") {
for (const fieldId of baseEvent.ids) {
const obj = this._objects[fieldId];
if (obj) {
obj.obj._reset();
}
}
}
return;
}