Skip to content

fix: Avoid situations where no grid item has focus/selection - #10603

Merged
gonfunko merged 1 commit into
mainfrom
color-nav
Oct 21, 2026
Merged

gonfunko merged 1 commit into
mainfrom
color-nav

Conversation

@gonfunko

Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes #10437

Proposed Changes

This PR updates Grid (used by FieldColour through its parent class FieldGridDropdown) to focus and select the first item if no item was focused by setSelectedValue() due to the provided value not being one of the options in the grid dropdown.

Arguably, FieldColour should have validated that its value was only set to one of the available options, but given that it doesn't, we're kind of stuck with that, as there are likely serialized projects with values for that field that are not in its picker. Given that constraint, falling back to selecting the first option in the grid seems reasonable and avoids a focus trap that could otherwise prevent keyboard navigation.

Reason for Changes

Before, keyboard users could encounter a difficult-to-escape focus trap if they edited a FieldColour whose value was not in its grid.

@gonfunko
gonfunko requested a review from a team as a code owner October 21, 2026 16:41
@gonfunko
gonfunko requested a review from mikeharv October 21, 2026 16:41
@github-actions github-actions Bot added the PR: fix Fixes a bug label Oct 21, 2026
@gonfunko
gonfunko merged commit 17f35cf into main Oct 21, 2026
11 checks passed
@gonfunko
gonfunko deleted the color-nav branch October 21, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FieldColour colour picker not navigable if current value is not on the palette

2 participants