Incorrect behavior of dirty listener

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
aleh.haidash
Posts: 32
Joined: Tue May 26, 2015 10:28 am

Incorrect behavior of dirty listener

Post by aleh.haidash » Fri Mar 02, 2018 2:22 pm

Hello.
I use Webapp 19.1 and faced with Incorrect behavior of dirty listener.
Steps to reproduce:
1) Open document, don't made any changes.
2) Using js api change readonly state

Code: Select all

editor.setReadOnlyState({readOnly:true});
3) I recived notify that dirty status was changed to TRUE

Code: Select all

goog.events.listen(editor, sync.api.Editor.EventTypes.DIRTY_STATUS_CHANGED, function(e) {
//here
});
4) Herewith the undo button becomes active

Why it happens? How can i avoid this situation?

Thanks.
Best Regards,
Aleh

mihaela
Posts: 204
Joined: Wed May 20, 2009 2:40 pm

Re: Incorrect behavior of dirty listener

Post by mihaela » Fri Mar 02, 2018 4:20 pm

Hi,

We did not reproduced the problem following the steps you provided.
Maybe you have some customization that modifies the document before setting the editor as read only.
If you remove the following line from your code the editor is still marked as modified after open?

Code: Select all

editor.setReadOnlyState({readOnly:true});
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com

Post Reply