Skip to content

Commit 5bf2b21

Browse files
committed
chore: add changelog entry
1 parent 0ab5679 commit 5bf2b21

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

packages/scoped-custom-element-registry/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
<!-- ## Unreleased -->
8+
## Unreleased
9+
10+
### Fixed
11+
12+
- toggleAttribute polyfill now retains the force argument if it is present
913

1014
# [0.0.5] - 2022-02-18
1115

packages/scoped-custom-element-registry/src/scoped-custom-element-registry.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -387,17 +387,19 @@ if (!ShadowRoot.prototype.createElement) {
387387
patchHTMLElement(definition.elementClass);
388388
new definition.elementClass();
389389
}
390-
// Approximate observedAttributes from the user class, since the stand-in element had none
391-
definition.observedAttributes.forEach((attr) => {
392-
if (instance.hasAttribute(attr)) {
393-
definition.attributeChangedCallback.call(
394-
instance,
395-
attr,
396-
null,
397-
instance.getAttribute(attr)
398-
);
399-
}
400-
});
390+
if (definition.attributeChangedCallback) {
391+
// Approximate observedAttributes from the user class, since the stand-in element had none
392+
definition.observedAttributes.forEach((attr) => {
393+
if (instance.hasAttribute(attr)) {
394+
definition.attributeChangedCallback.call(
395+
instance,
396+
attr,
397+
null,
398+
instance.getAttribute(attr)
399+
);
400+
}
401+
});
402+
}
401403
if (isUpgrade && definition.connectedCallback && instance.isConnected) {
402404
definition.connectedCallback.call(instance);
403405
}

0 commit comments

Comments
 (0)