Skip to content

Commit

Permalink
revert 63578ce
Browse files Browse the repository at this point in the history
Signed-off-by: Wouter Vroege <[email protected]>
  • Loading branch information
woutervroege committed Apr 5, 2020
1 parent 3a748b3 commit 2b7f4ed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/dom-properties-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const DOMProperties = (SuperClass) => class extends SuperClass {
if(oldValue === newValue) return;
const propName = this.constructor.__getPropertyNameByAttributeName.call(this, attrName);
if(!propName) return;
this.constructor.__setDOMProperty.call(this, propName, oldValue, this.getAttribute(attrName));
this.constructor.__setDOMProperty.call(this, propName, this[propName], newValue);
}

static __saveInitialAttributeValues() {
Expand All @@ -42,11 +42,11 @@ export const DOMProperties = (SuperClass) => class extends SuperClass {
for(let i in DOMPropertyNames) if(DOMPropertyNames[i].toLowerCase() === attrName) return DOMPropertyNames[i];
}

static __setDOMProperty(propName, oldValue, value) {
static __setDOMProperty(propName, oldValue, newValue) {
const converters = this.constructor.propertyFromAttributeConverters || {};
const converter = converters[propName];
if(converter) value = converter.call(this, oldValue, value);
this[propName] = value;
if(converter) newValue = converter.call(this, oldValue, newValue);
this[propName] = newValue;
}

};

0 comments on commit 2b7f4ed

Please sign in to comment.