Skip to content

Prevent buffering of type changes #56

Description

@kboucher

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions