-2

I'm rendering a list of items to allow their editing and I'm saving the changes immediately to back-end. I'm using the following code:

<div ng-repeat="person in people">
    <label>{{person.name}}</label>
    <input type="number" ng-model="person.age" ng-change="person.save()" ng-disabled="person.saving" >
</div>

and the input blurs each time I edit the value (see fiddle).

The only similar question I was able to find on SO didn't help me.

Community
  • 1
  • 1
hon2a
  • 7,006
  • 5
  • 41
  • 55

1 Answers1

0

Turns out the problem was in disabling the input while saving to back-end. Each time the input is disabled, it loses focus. So, even though the saving took such a short time that I couldn't see the input being disabled and enabled again, I could observe the resulting blur.

hon2a
  • 7,006
  • 5
  • 41
  • 55