Relying on ember-buffered-proxy to detect model changes has the drawback that comparisons are strict, and therefore a simple type change is captured by the buffer.
When using an HTML input to edit the value of a model property that is defined as a number, the value is returned from the input as a string. This results in hasChanges being true, when in fact the value has not changed, only the type has changed.
Ember serializers will convert this value back to a number based on the model definition when posted to the server, but the buffer recognizing this as a change means it cannot be relied upon for something like enabling/disabling a Save button in a form.
I'm not sure whether the solution would be to do only value comparisons in ember-buffered-proxy or to support a flag that would allow value only comparisons.
Relying on
ember-buffered-proxyto detect model changes has the drawback that comparisons are strict, and therefore a simple type change is captured by the buffer.When using an HTML
inputto edit the value of a model property that is defined as a number, the value is returned from the input as a string. This results inhasChangesbeing true, when in fact the value has not changed, only the type has changed.Ember serializers will convert this value back to a number based on the model definition when posted to the server, but the buffer recognizing this as a change means it cannot be relied upon for something like enabling/disabling a Save button in a form.
I'm not sure whether the solution would be to do only value comparisons in
ember-buffered-proxyor to support a flag that would allow value only comparisons.