angular-ui / ui-tinymce

AngularUI wrapper for TinyMCE
MIT License
488 stars 371 forks source link

Form gets $dirty after touching the model. #238

Closed MrMartiniMo closed 8 years ago

MrMartiniMo commented 8 years ago

Still running into the form gets $dirty issue (#48, #107).

http://plnkr.co/edit/INfZpLpz2yrRvlHitw1N?p=preview

deeg commented 8 years ago

The plunker does not seem to load angular-ui-tinymce correctly.

Do you mind fixing it up and I can take a look?

MrMartiniMo commented 8 years ago

plunker updated. thanks @deeg

deeg commented 8 years ago

Thanks for updating, it indeed still seems like a bug.

I will take a look into fixing it. PRs are welcome if you already started looking at it.

MrMartiniMo commented 8 years ago

It is somewhere in updateView.

console.log('dirty', form.$dirty)
ngModel.$setViewValue(content);
console.log('dirty', form.$dirty)

Maybe we need to check if the content has changed or not. But updateView is called twice, before and after ngModel's value has been changed.

raphael-m commented 7 years ago

It seems that the issue still exists when debounce is set to false.