Skip to content

fix: check first string in common word prefix and suffix - #10706

Open
matthewalberto wants to merge 1 commit into
RaspberryPiFoundation:mainfrom
matthewalberto:fix/common-word-prefix-order
Open

matthewalberto wants to merge 1 commit into
RaspberryPiFoundation:mainfrom
matthewalberto:fix/common-word-prefix-order

Conversation

@matthewalberto

Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes #10705

Proposed Changes

Change the two post-loop checks in commonWordPrefix and commonWordSuffix to include the first string.

Reason for Changes

The result currently depends on option order. This can prevent dropdown labels from being trimmed even when they share a complete word.

Test Coverage

One new dropdown test and two additional checks in the existing prefix and suffix tests. All three fail against the original implementation and pass with the fix. npm test passes (8 of 8 Nx tasks), and Prettier and ESLint are clean.

dropdown-trim-before-fix dropdown-trim-after-fix

Documentation

No documentation changes needed.

Additional Information

Claude Code (Claude Opus 5.5) identified and fixed the bug, added three tests, and ran the build. I wrote the issue and PR descriptions and did Playground validation.

@matthewalberto
matthewalberto requested a review from a team as a code owner November 20, 2026 04:12
@github-actions github-actions Bot added the PR: fix Fixes a bug label Nov 20, 2026

This branch has not been deployed

No deployments
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.

A dropdown with "10 minutes" before "10 min" isn't trimmed

2 participants