Skip to content
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

Fix TypeScript breakages by specifying types for overridden setAttribute and getAttribute. #5650

Merged
merged 2 commits into from
Apr 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions lib/legacy/legacy-element-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,12 @@ export const LegacyElementMixin = dedupingMixin((base) => {
}
}

/** @override */
/**
* Sets the value of an attribute.
* @override
* @param {string} name The name of the attribute to change.
* @param {string} value The new attribute value.
*/
setAttribute(name, value) {
if (legacyNoObservedAttributes && !this._legacyForceObservedAttributes) {
const oldValue = this.getAttribute(name);
Expand All @@ -155,7 +160,11 @@ export const LegacyElementMixin = dedupingMixin((base) => {
}
}

/** @override */
/**
* Removes an attribute.
* @override
* @param {string} name The name of the attribute to remove.
*/
removeAttribute(name) {
if (legacyNoObservedAttributes && !this._legacyForceObservedAttributes) {
const oldValue = this.getAttribute(name);
Expand Down