Skip to content

Commit 07d1466

Browse files
fix: Accordion set to hidden when assigned to content set panel (#1238)
* test: Remove demo page from compiled assets * test: Prettier + pre-build script * test: Update content set bug and baselines * fix: Revert demo listing changes * fix: Update changelog * fix: Add a test to ensure the nested tab/accordion isn't hidden * fix: Swap to using a custom attribute instead of an id Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent db399dc commit 07d1466

File tree

6 files changed

+9
-4
lines changed

6 files changed

+9
-4
lines changed

CHANGELOG-1.x.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 1.0.1 ( TBD )
2+
3+
- [](https://github.com/patternfly/patternfly-elements/commit/) fix: Accordion assigned to content set panel was always being set to hidden
14
## 1.0.0 ( 2020-12-02 )
25

36
- [e86f33e](https://github.com/patternfly/patternfly-elements/commit/e86f33e0342933f1992d52a022f9a25fd1e2fbeb) feat: Add standard attribute/property definitions
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div id="lightdom" hidden>
22
<slot></slot>
33
</div>
4-
<pfe-tabs hidden></pfe-tabs>
5-
<pfe-accordion hidden></pfe-accordion>
4+
<pfe-tabs hidden visible-at="large"></pfe-tabs>
5+
<pfe-accordion hidden visible-at="small"></pfe-accordion>

elements/pfe-content-set/src/pfe-content-set.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ class PfeContentSet extends PFElement {
113113

114114
get tab() {
115115
// Check if the appropriate tag exists already
116-
return this.shadowRoot.querySelector(PfeTabs.tag);
116+
return this.shadowRoot.querySelector(`${PfeTabs.tag}[visible-at="large"]`);
117117
}
118118

119119
get accordion() {
120120
// Check if the appropriate tag exists already
121-
return this.shadowRoot.querySelector(PfeAccordion.tag);
121+
return this.shadowRoot.querySelector(`${PfeAccordion.tag}[visible-at="small"]`);
122122
}
123123

124124
get displayTemplate() {

elements/pfe-content-set/test/pfe-content-set_test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ suite('<pfe-content-set>', () => {
149149
assert.isNotNull(firstChild);
150150
assert.equal(firstChild.tagName, "PFE-TABS");
151151
assert.equal(pfeAccordion.tagName, "PFE-ACCORDION");
152+
assert.isFalse(pfeAccordion.hasAttribute("hidden"));
152153
});
153154

154155
test(
@@ -161,6 +162,7 @@ suite('<pfe-content-set>', () => {
161162
assert.isNotNull(firstChild);
162163
assert.equal(firstChild.tagName, "PFE-TABS");
163164
assert.equal(pfeTabs.tagName, "PFE-TABS");
165+
assert.isFalse(pfeTabs.hasAttribute("hidden"));
164166
});
165167

166168
test("it should set the correct \"on\" attribute from a parent component that has a color attribute",
-4.69 KB
Loading
20 KB
Loading

0 commit comments

Comments
 (0)