Skip to content
This repository was archived by the owner on Apr 4, 2019. It is now read-only.

Change setProperty and morph to remove an undefined or NaN attr value #248

Merged
merged 1 commit into from
Jan 11, 2015

Conversation

mixonic
Copy link
Collaborator

@mixonic mixonic commented Jan 10, 2015

Open for debate. Maybe this should be part of another layer in Ember. IMO it is ok here.

Ember expects setting an attribute binding to undefined or NaN to remove the attribute entirely. This follows that logic.

@oneeman
Copy link
Contributor

oneeman commented Jan 10, 2015

Does updateAttributeNS also need to be updated? And this might be a good opportunity to DRY it up a bit as well (e.g. L170-178 and L184-192 in dom-helper.js, but maybe also the check for remove attribute between there and attr-morph).

As for whether it belongs here, maybe someone else can chime in. I don't know the ember code yet, so I wouldn't know what should go where.

@mixonic mixonic force-pushed the attribute-bindings branch 2 times, most recently from 59d4d9f to ad3d43b Compare January 11, 2015 00:40
@mixonic
Copy link
Collaborator Author

mixonic commented Jan 11, 2015

The Ember side is here: emberjs/ember.js#10186. This is updated to test and work with namespace attrs. And be a bit more DRY.

@mixonic
Copy link
Collaborator Author

mixonic commented Jan 11, 2015

Phantom has no native isNaN. function isNan(x) { return x !== x } is a possible poly-fill.

@mixonic mixonic force-pushed the attribute-bindings branch from ad3d43b to 101af01 Compare January 11, 2015 05:17
@mixonic
Copy link
Collaborator Author

mixonic commented Jan 11, 2015

After discussion with @rwjblue I've dropped the NaN check.

In Ember, I'm leaving the NaN value behavior undefined: https://github.com/emberjs/ember.js/pull/10186/files#diff-f7920bfff32661282a5d9c883cc26641L43

@oneeman
Copy link
Contributor

oneeman commented Jan 11, 2015

Thanks!

oneeman added a commit that referenced this pull request Jan 11, 2015
Change setProperty and morph to remove an undefined attr value
@oneeman oneeman merged commit 97be6bc into tildeio:master Jan 11, 2015
@rwjblue
Copy link
Collaborator

rwjblue commented Jan 11, 2015

@mixonic - Let me know when you need a version cut for the Ember updates.

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

Successfully merging this pull request may close these issues.

3 participants