From 0660ae5fec7f427149f73b6142acc7fbdcc0298f Mon Sep 17 00:00:00 2001 From: Boyan Rakilovski Date: Mon, 1 Jul 2024 09:51:44 +0300 Subject: [PATCH] fix(ui5-color-palette-popover): enable navigation over the swatches (#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. --- packages/main/src/ColorPalette.ts | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/packages/main/src/ColorPalette.ts b/packages/main/src/ColorPalette.ts index a4838bbe5dde..78df1bf7aac1 100644 --- a/packages/main/src/ColorPalette.ts +++ b/packages/main/src/ColorPalette.ts @@ -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) { @@ -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]; }