ember-buffered-proxy icon indicating copy to clipboard operation
ember-buffered-proxy copied to clipboard

Prevent buffering of type changes

Open kboucher opened this issue 5 years ago • 0 comments

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.

kboucher avatar Mar 25 '20 15:03 kboucher