vitalets / angular-xeditable

Edit in place for AngularJS
http://vitalets.github.io/angular-xeditable
MIT License
1.91k stars 403 forks source link

Cancel button does not cancel if currently editing a different field #668

Closed Glassig closed 7 years ago

Glassig commented 7 years ago

I have two editable textareas next to each other. If I start to edit one of them, then starts to edit the next one, the first is still open for editing (this is okay). However, when I click the cancel button for the first, it just closes the editing without resetting the field.

Also, for some reason it saves the field without running the "onbeforesave" function, because if I have errors for that field it just ignores it and saves.

ckosloski commented 7 years ago

Can you post a jsfiddle or plunkr showing your issue?

Glassig commented 7 years ago

I just figured out what it is. I want to count the amount of characters on the input. So I have the editable field change the value {{ctrl.value}}, and then displays the amount on another place with {{ctrl.value.length}}. Then I use e-ng-change to set ctrl.value to the new value. I guess that is why the cancel doesn't work. My bad. Thanks for answering so quickly anyway!