Skip to content

Commit 76b1ee1

Browse files
authored
fix: pfe-tabs urlParms fix for IE11 (#821)
* fix: removing stopPropagation from pfe-tabs click and keydown events Fixes #816 * updating the changelog * should be currentTarget instead of event.target event.target broke pfe-content-set. Using event.currenTarget is the right way to look for the selected tab. * using event.currentTarget instead of foundTab * moving the urlParams logic into the if statement for IE * changelog update
1 parent 9d3fd43 commit 76b1ee1

File tree

2 files changed

+27
-21
lines changed

2 files changed

+27
-21
lines changed

CHANGELOG-prerelease.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## Prerelease 44 ( 2020-04-02 )
2+
3+
Tag: [v1.0.0-prerelease.44](https://github.com/patternfly/patternfly-elements/releases/tag/v1.0.0-prerelease.44)
4+
5+
- []() fix: pfe-tabs urlParms fix for IE11 #821
6+
17
## Prerelease 43 ( 2020-04-02 )
28

39
Tag: [v1.0.0-prerelease.43](https://github.com/patternfly/patternfly-elements/releases/tag/v1.0.0-prerelease.43)

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -449,28 +449,28 @@ class PfeTabs extends PFElement {
449449
// https://caniuse.com/#search=urlsearchparams
450450
if (CAN_USE_URLSEARCHPARAMS) {
451451
urlParams = new URLSearchParams(window.location.search);
452-
}
453452

454-
// @DEPRECATED
455-
// the "pfe-" prefix has been deprecated but we'll continue to support it
456-
// we'll give priority to the urlParams.has(`${this.id}`) attribute first
457-
// and fallback to urlParams.has(`pfe-${this.id}`) if it exists. We should
458-
// be able to remove the || part of the if statement in the future
459-
const tabsetInUrl =
460-
urlParams.has(`${this.id}`) ||
461-
urlParams.has(this.getAttribute("pfe-id")) ||
462-
urlParams.has(`pfe-${this.id}`); // remove this condition when it's no longer used in production
463-
464-
if (urlParams && tabsetInUrl) {
465-
const id =
466-
urlParams.get(`${this.id}`) ||
467-
urlParams.get(this.getAttribute("pfe-id")) ||
468-
urlParams.get(`pfe-${this.id}`); // remove this condition when it's no longer used in production
469-
470-
tabIndex = this._allTabs().findIndex(tab => {
471-
const tabId = tab.id || tab.getAttribute("pfe-id");
472-
return tabId === id;
473-
});
453+
// @DEPRECATED
454+
// the "pfe-" prefix has been deprecated but we'll continue to support it
455+
// we'll give priority to the urlParams.has(`${this.id}`) attribute first
456+
// and fallback to urlParams.has(`pfe-${this.id}`) if it exists. We should
457+
// be able to remove the || part of the if statement in the future
458+
const tabsetInUrl =
459+
urlParams.has(`${this.id}`) ||
460+
urlParams.has(this.getAttribute("pfe-id")) ||
461+
urlParams.has(`pfe-${this.id}`); // remove this condition when it's no longer used in production
462+
463+
if (urlParams && tabsetInUrl) {
464+
const id =
465+
urlParams.get(`${this.id}`) ||
466+
urlParams.get(this.getAttribute("pfe-id")) ||
467+
urlParams.get(`pfe-${this.id}`); // remove this condition when it's no longer used in production
468+
469+
tabIndex = this._allTabs().findIndex(tab => {
470+
const tabId = tab.id || tab.getAttribute("pfe-id");
471+
return tabId === id;
472+
});
473+
}
474474
}
475475

476476
return tabIndex;

0 commit comments

Comments
 (0)