vitalets / angular-xeditable

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

Changing text on input does not save the changes with buttons = no #673

Closed ZivW44 closed 7 years ago

ZivW44 commented 7 years ago

I don't want to use buttons and I want the value to be saved.

I have made this fiddle

Supplying buttons: 'no' and submit on blur

When I click on a button element that has ng-click, the value is not changed only after the ng-click has ended.

To replicate - try to change the value on the User.Name and click the button.

Added: If I add a $timeout(...), it will work.

ckosloski commented 7 years ago

The reason the select works is because when you select a new item in the list, that is the blur. What are you trying to do with the button and why is timeout not an option?

ZivW44 commented 7 years ago

The button is collecting data for later send the server, so if a user press this button, the value will still be the old value.

timeout is an option but I prefer not to use timeout if not needed. Do you not consider this a bug? basically with button='no' I would expect that the value will be changed on change, not on blur. (the docs states on change)

ckosloski commented 7 years ago

The select input is setup so that it saves on change for no buttons, which works well for a select. A text input is not setup the same way and I'm not sure it would work as well. I think the best thing to do is use the timeout