Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent buffering of type changes #56

Open
kboucher opened this issue Mar 25, 2020 · 0 comments
Open

Prevent buffering of type changes #56

kboucher opened this issue Mar 25, 2020 · 0 comments

Comments

@kboucher
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant