Page 1 of 1

Attributes are removing after undo

Posted: Fri Dec 02, 2022 9:41 am
by shilpa
Hi Team,
I am working on copy and paste attributes from one tag to another similar tag.
In the below screenshot. I am copying the attributes from first cite.query and pasting to the second empty cite.query.
image.png
image.png (12.49 KiB) Viewed 384 times
after paste i got below result
image.png
image.png (13.29 KiB) Viewed 384 times
Now if i do undo i am getting below result
image.png
image.png (10.4 KiB) Viewed 384 times
So in above screenshot when i do undo it should retain the original attributes but here the attributes are removing.

the java code used is
image.png
image.png (86.84 KiB) Viewed 384 times
Please help me on this.

Thanks & Regards
Shilpa.P

Re: Attributes are removing after undo

Posted: Fri Dec 02, 2022 12:09 pm
by cristi_talau
Hello,

The problem is that "element.removeAttribute()" is a low-level method that modifies the element outside of the undoable edit. You should use "controller.removeAttribute(element, ...)" instead.

Best,
Cristian