diff --git a/lib/legacy/legacy-element-mixin.js b/lib/legacy/legacy-element-mixin.js index 151a13fa56..a6d00c1671 100644 --- a/lib/legacy/legacy-element-mixin.js +++ b/lib/legacy/legacy-element-mixin.js @@ -816,11 +816,13 @@ export const LegacyElementMixin = dedupingMixin((base) => { * @param {string} name HTML attribute name * @param {boolean=} bool Boolean to force the attribute on or off. * When unspecified, the state of the attribute will be reversed. - * @param {Element=} node Node to target. Defaults to `this`. * @return {boolean} true if the attribute now exists */ - toggleAttribute(name, bool, node) { - node = /** @type {Element} */ (node || this); + toggleAttribute(name, bool) { + let node = /** @type {Element} */ this; + if (arguments.length === 3) { + node = /** @type {Element} */ arguments[2]; + } if (arguments.length == 1) { bool = !node.hasAttribute(name); }