Skip to content

Commit

Permalink
fix(ui5-color-palette-popover): enable navigation over the swatches (S…
Browse files Browse the repository at this point in the history
…AP#9336)

Issue:

- The ui5-color-palette gets re-rendered on each keyboard navigation in the swatches grid.
In the onAfterRendering hook there was a logic active only when in ui5-color-palette-popover,
which sets the focused element to the first swatch. As a result the keyboard navigation in the grid
was't possible.
  • Loading branch information
unazko authored Jul 1, 2024
1 parent 4d685f3 commit 0660ae5
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions packages/main/src/ColorPalette.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,6 @@ class ColorPalette extends UI5Element {
this.recentColorsElements[0].selected = true;
this.recentColorsElements[0].focus();
}

if (this.popupMode) {
if (this.showDefaultColor) {
this.focusFirstFocusableElement();
} else {
this.focusFirstDisplayColorElement();
}
}
}

selectColor(item: ColorPaletteItem) {
Expand Down Expand Up @@ -481,14 +473,6 @@ class ColorPalette extends UI5Element {
itemNavigation._focusCurrentItem();
}

focusFirstDisplayColorElement() {
this.focusColorElement(this.displayedColors[0], this._itemNavigation);
}

focusFirstFocusableElement() {
this.firstFocusableElement.focus();
}

get firstFocusableElement() {
return this.colorPaletteNavigationElements[0];
}
Expand Down

0 comments on commit 0660ae5

Please sign in to comment.