Attributes are removing after undo

Having trouble installing Oxygen? Got a bug to report? Post it all here.
shilpa
Posts: 68
Joined: Mon Jul 04, 2022 8:42 am

Attributes are removing after undo

Post 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
after paste i got below result
image.png
Now if i do undo i am getting below result
image.png
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
Please help me on this.

Thanks & Regards
Shilpa.P
You do not have the required permissions to view the files attached to this post.
cristi_talau
Posts: 517
Joined: Thu Sep 04, 2014 4:22 pm

Re: Attributes are removing after undo

Post 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
Post Reply