-
Notifications
You must be signed in to change notification settings - Fork 165
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
[Custom Elements] Calling setAttribute
with a non-lower cased attribute name does not trigger attributeChangedCallback
#110
Comments
* Changes property options to support `converter` Fixes #264 Changes `type` to be only a hint to the `converter` option which has the previous `type` functionality, an object with `toAttribute` and `fromAttribute` or just a function which is `fromAttribute`. In addition to the `value` these functions now also get the property's `type`. Also provides a default converter that supports `Boolean`, `String`, `Number`, `Object`, and `Array` out of the box. In addition, numbers and strings now become `null` if their reflected attribute is removed. * Format * Address review feedback * Update CHANGELOG.md * Clarify documentation about default converter * Format * Fix test to use lowercase attribute names This is working around https://github.com/webcomponents/custom-elements/issues/167. * Fix test on IE * Address review feedback Remove superfluous null checks * Makes reflection more consistent Previously, when an attribute changed as a result of a reflecting property changing, the property was prevented from mutating again as can happen when a custom `converter` is used. Now, the oppose is also true. When a property changes as a result of an attribute changing, the attribute is prevented from mutating again This change helps ensure that when a user calls `setAttribute`, a `converter.toAttribute` does not cause the attribute to immediately mutate. This is unexpected behavior and this change discourages it. * Format. * Address review feedback. * Address review feedback Ensure Object/Array properties respect `undefined` (no change to attribute) and `null` (remove attribute) values.
setAttribute
with a non-lower cased attribute name does not trigger attributeChangedCallback
setAttribute
with a non-lower cased attribute name does not trigger attributeChangedCallback
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed after being marked stale. If you're still facing this problem with the above solution, please comment and we'll reopen! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
If
foo
is inobservedAttributes
andsetAttribute('FoO', '2')
is called, in Chrome with native custom elements, theattributeChangedCallback
is called with the attribute name set tofoo
(lowercased). When using the custom elements polyfill, theattributeChangedCallback
is not called..See: http://jsbin.com/fiyufid/edit?html,console,output
The text was updated successfully, but these errors were encountered: