Skip to content

Commit 9381e37

Browse files
authored
fix: pfe-tabs adding dynamic tab in IE11 (#838)
Fixes #836
1 parent f9c2813 commit 9381e37

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

CHANGELOG-prerelease.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## Prerelese 45 ( TBD )
22

3+
- [](https://github.com/patternfly/patternfly-elements/commit/) fix: pfe-tabs adding dynamic tab in IE11 #838
34
- [eb74cb8](https://github.com/patternfly/patternfly-elements/commit/eb74cb8f989048164fbb6ed1508c502659a752ed) feat: add event emission to pfe-select
45
- [](https://github.com/patternfly/patternfly-elements/commit/) fix: Add a warning about updating the on attribute before upgrade
56

elements/pfe-tabs/src/pfe-tabs.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ const KEYCODE = {
1616
// https://caniuse.com/#search=urlsearchparams
1717
const CAN_USE_URLSEARCHPARAMS = window.URLSearchParams ? true : false;
1818

19+
const TABS_MUTATION_CONFIG = {
20+
childList: true,
21+
subtree: true
22+
};
23+
1924
function generateId() {
2025
return Math.random()
2126
.toString(36)
@@ -88,7 +93,7 @@ class PfeTabs extends PFElement {
8893
this._init();
8994
}
9095

91-
this._observer.observe(this, { childList: true });
96+
this._observer.observe(this, TABS_MUTATION_CONFIG);
9297
});
9398
}
9499

@@ -235,7 +240,7 @@ class PfeTabs extends PFElement {
235240
if (mutationsList) {
236241
for (let mutation of mutationsList) {
237242
if (mutation.type === "childList" && mutation.addedNodes.length) {
238-
mutation.addedNodes.forEach(addedNode => {
243+
[...mutation.addedNodes].forEach(addedNode => {
239244
if (
240245
addedNode.tagName.toLowerCase() === PfeTab.tag ||
241246
addedNode.tagName.toLowerCase() === PfeTabPanel.tag
@@ -279,7 +284,7 @@ class PfeTabs extends PFElement {
279284
this._linked = true;
280285

281286
if (window.ShadyCSS) {
282-
this._observer.observe(this, { childList: true });
287+
this._observer.observe(this, TABS_MUTATION_CONFIG);
283288
}
284289
}
285290

0 commit comments

Comments
 (0)