WebViewer Version:
8.11
Do you have an issue with a specific file(s)?
No
Can you reproduce using one of our samples or online demos?
Yes
Are you using the WebViewer server?
No
Does the issue only happen on certain browsers?
No
Is your issue related to a front-end framework?
Yes
Is your issue related to annotations?
Yes
Please give a brief summary of your issue:
When I move my TextWidgetAnnotation from a page to another, the name change
I have to do a dirty code to prevent that problem, Is there a way to do better ?
annotationManager.addEventListener('annotationChanged', (annotations, action, { imported }) => {
if (action == 'delete' && annotations && annotations.length == 1) {
me.fieldPageMoving = { currentAnnotation: annotations[0], currentDate: new Date() };
}
if (
action == 'add' &&
annotations &&
annotations.length == 1 &&
me.fieldPageMoving &&
me.fieldPageMoving.currentDate &&
new Date().getTime() - me.fieldPageMoving.currentDate.getTime() < 1000 * 2 &&
me.fieldPageMoving.currentAnnotation['xi'] &&
me.fieldPageMoving.currentAnnotation['xi']['trn-form-field-name'] &&
annotations[0]['xi'] &&
annotations[0]['xi']['trn-form-field-name'] &&
annotations[0]['xi']['trn-form-field-name'].indexOf('TextFormField') != -1
) {
const c_annot: Core.Annotations.Annotation = annotations[0];
c_annot['xi']['trn-form-field-name'] = me.fieldPageMoving.currentAnnotation['xi']['trn-form-field-name'];
}
});
I got a second question :
Is there an eventListener for the Apply change button ?