Skip to content

fix(ui5-color-palette): stop stealing focus after keyboard navigation#13726

Open
hinzzx wants to merge 2 commits into
mainfrom
test/cpp-failing-tests-fix
Open

fix(ui5-color-palette): stop stealing focus after keyboard navigation#13726
hinzzx wants to merge 2 commits into
mainfrom
test/cpp-failing-tests-fix

Conversation

@hinzzx

@hinzzx hinzzx commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

WIP Not for merge yet.

Investigating the test failures in a production pipeline, as they appear stable locally (weren't stable before).

@hinzzx hinzzx temporarily deployed to netlify-preview June 24, 2026 11:16 — with GitHub Actions Inactive
@sap-ui5-webcomponents-release

Copy link
Copy Markdown

@hinzzx hinzzx temporarily deployed to netlify-preview June 24, 2026 11:30 — with GitHub Actions Inactive
*/
_focusFirstAvailable(...candidates: Array<() => boolean>): boolean {
return candidates.some(focusAction => focusAction());
if (!candidates.length) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of recursion here? Theoretically it does the same thing like candidates.some(focusAction => focusAction());

}

if (this._isPrevious(e) && this._isFirstSwatch(target, this.displayedColors)) {
if (this._isPrevious(e) && swatchTarget && this._isFirstSwatch(swatchTarget, this.displayedColors)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have swatchTarget in all statements we could have early return in case !swatchTarget


if (this._isNext(e) && this._isLastSwatch(target, this.recentColorsElements)) {
if (this._isNext(e) && swatchTarget && this._isLastSwatch(swatchTarget, this.recentColorsElements)) {
e.preventDefault();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we could have also early return in case !swatchTarget

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants