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

[Pivots] Support toggleAttribute and attributes #3173

Closed
nolanlawson opened this issue Nov 16, 2022 · 3 comments
Closed

[Pivots] Support toggleAttribute and attributes #3173

nolanlawson opened this issue Nov 16, 2022 · 3 comments
Labels

Comments

@nolanlawson
Copy link
Contributor

Description

Pivot classes currently handle setAttribute and removeAttribute, but not toggleAttribute or attributes:

defineProperties(instance, {
setAttribute: {
value: function setAttribute(name: string, value: any) {
if (newObservedAttributes.has(name)) {
const old = nativeGetAttribute.call(this, name);
nativeSetAttribute.call(this, name, value);
try {
attributeChangedCallback!.call(this, name, old, value + '');
} catch (error) {
throwAsyncError(error);
}
} else {
nativeSetAttribute.call(this, name, value);
}
},
writable: true,
enumerable: true,
configurable: true,
},
removeAttribute: {
value: function removeAttribute(name: string) {
if (newObservedAttributes.has(name)) {
const old = nativeGetAttribute.call(this, name);
nativeRemoveAttribute.call(this, name);
try {
attributeChangedCallback!.call(this, name, old, null);
} catch (error) {
throwAsyncError(error);
}
} else {
nativeRemoveAttribute.call(this, name);
}
},
writable: true,
enumerable: true,
configurable: true,
},
});

Related: #2994

@git2gus
Copy link

git2gus bot commented Nov 16, 2022

This issue has been linked to a new work item: W-12075447

@nolanlawson
Copy link
Contributor Author

Pivots were dropped in #3310

@caridy
Copy link
Contributor

caridy commented Jan 30, 2023

@rwaldron do we need this in locker?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants