fix(client/pdf): form elements not detected for save

This commit is contained in:
Elian Doran 2025-12-29 13:29:04 +02:00
parent 406232c478
commit 7836de3f08
No known key found for this signature in database

View File

@ -36,9 +36,10 @@ function manageSave(app: typeof window.PDFViewerApplication) {
}, 2_000);
}
app.pdfDocument.annotationStorage.onSetModified = debouncedSave; // works great for most cases, including forms.
app.eventBus.on("annotationeditorcommit", debouncedSave);
app.eventBus.on("annotationeditorparamschanged", debouncedSave);
app.eventBus.on("annotationeditorstateschanged", evt => {
app.eventBus.on("annotationeditorstateschanged", evt => { // needed for detecting when annotations are moved around.
const { activeEditorId } = evt;
// When activeEditorId becomes null, an editor was just committed