Skip to content

Commit e75cd85

Browse files
authored
Merge branch 'main' into fix/jump-links-nav-label
2 parents ee4bdba + a060b8b commit e75cd85

23 files changed

Lines changed: 117 additions & 12 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@patternfly/elements": patch
3+
---
4+
5+
`<pf-back-to-top>`: fixed background color during hover and focus.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
"@patternfly/create-element": patch
3+
---
4+
Fixed missing files in published package that prevented `npm run new` from working

.changeset/fix-create-element.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@patternfly/create-element": patch
3+
---
4+
5+
Fixed missing entry point in published package.

.changeset/fix-popover-click.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@patternfly/elements": patch
3+
---
4+
5+
`<pf-popover>`: clicking outside a popover no longer fires spurious
6+
hide events on other closed popovers.

.changeset/fix-select-tokens.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@patternfly/elements": patch
3+
---
4+
5+
`<pf-select>`: replaced Red Hat Design System color tokens with PatternFly v4 global tokens.

.changeset/fix-slot-controller.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@patternfly/pfe-core": patch
3+
---
4+
5+
`SlotController`: fixed `getSlotted()` returning empty arrays in
6+
certain timing scenarios.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@patternfly/elements": patch
3+
---
4+
5+
`npm run start` no longer fails when TypeScript build artifacts
6+
are present in the working tree.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
"@patternfly/elements": patch
3+
---
4+
`<pf-table>`: fix accessibility features: column header role, accessible label for row toggle button, etc.

.changeset/tabs-passive-scroll.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@patternfly/elements": patch
3+
---
4+
5+
`<pf-tabs>`: scroll event listeners are now passive for better performance.

core/pfe-core/controllers/slot-controller.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,26 @@ export class SlotController implements SlotControllerPublicAPI {
215215
*/
216216
public getSlotted<T extends Element = Element>(...slotNames: string[] | [null]): T[] {
217217
if (!slotNames.length || slotNames.length === 1 && slotNames.at(0) === null) {
218-
return (this.#slotRecords.get(SlotController.default)?.elements ?? []) as T[];
218+
return (this.#getAssignedElements(SlotController.default)) as T[];
219219
} else {
220220
return slotNames.flatMap(slotName =>
221-
this.#slotRecords.get(slotName ?? SlotController.default)?.elements ?? []) as T[];
221+
this.#getAssignedElements(slotName ?? SlotController.default)) as T[];
222222
}
223223
}
224224

225+
/**
226+
* Returns the assigned elements for a given slot name, falling back to
227+
* querying the slot element directly if the slot record hasn't been
228+
* initialized yet.
229+
*/
230+
#getAssignedElements(slotId: string | symbol): Element[] {
231+
const record = this.#slotRecords.get(slotId);
232+
if (record) {
233+
return record.elements;
234+
}
235+
return this.#getSlotElement(slotId)?.assignedElements?.() ?? [];
236+
}
237+
225238
/**
226239
* Returns a boolean statement of whether or not any of those slots exists in the light DOM.
227240
* @param names The slot names to check.

0 commit comments

Comments
 (0)