Skip to content

Commit

Permalink
Make sure _valueToNodeAttribute uses wrap
Browse files Browse the repository at this point in the history
This ensures attributes bindings to class, name, and slot behave correctly when `ShadyDOM.noPatch` is set.
  • Loading branch information
Steven Orvell committed Dec 20, 2018
1 parent e73285b commit 4e4d6fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/mixins/properties-changed.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import '../utils/boot.js';

import { dedupingMixin } from '../utils/mixin.js';
import { microTask } from '../utils/async.js';
import { wrap } from 'module';

/** @const {!AsyncInterface} */
const microtask = microTask;
Expand Down Expand Up @@ -495,6 +496,9 @@ export const PropertiesChanged = dedupingMixin(
if (str === undefined) {
node.removeAttribute(attribute);
} else {
if (attribute === 'class' || attribute === 'name' || attribute === 'slot') {
node = wrap(node);
}
node.setAttribute(attribute, str);
}
}
Expand Down

0 comments on commit 4e4d6fe

Please sign in to comment.