Closed bicknellr closed 8 years ago
Is this a breaking change? Like, did it use to work with both and now it doesn't?
Hmm. Previously, the behavior for finding the item's key was pretty much item[attrForSelected] || item.getAttribute(attrForSelected)
. You could reference attributes or properties, but not both, because of the different cases. If I'm reading dashToCamelCase
's implementation right, it shouldn't actually change the behavior for passing camel case strings since dashToCamelCase
won't actually modify it. So, this change actually handles more cases but adds (unenforced) restrictions to the API. <- I'd say minor version bump for this reason, even though this should still work in all the cases we had before without changes.
p.s. I just noticed dashToCamelCase
does its own caching, but it has to do a lookup rather than just one comparison; do you think this makes _lastAttrForSelected
/_lastPropertyNameForSelected
stuff here overkill?
@bicknellr Yeaaah i'd say lookups are free, so maybe keep it cleaner and don't do your own caching?
Ok, I removed the caching, so it's just a call to dashToCamelCase
now.
LGTM if the comment becomes more of a warning/advice :)
👌
Continuation of #101. (Fixes #57.)