Skip to content

fix: dark mode on multi select component#6316

Merged
talissoncosta merged 2 commits into
mainfrom
fix/dark-mode-styling-missing-for-multiselect-component
Nov 24, 2025
Merged

fix: dark mode on multi select component#6316
talissoncosta merged 2 commits into
mainfrom
fix/dark-mode-styling-missing-for-multiselect-component

Conversation

@talissoncosta
Copy link
Copy Markdown
Contributor

@talissoncosta talissoncosta commented Nov 21, 2025

Thanks for submitting a PR! Please check the boxes below:

  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

Fixed dark mode styling issues in the MultiSelect component where text was difficult or impossible to read due to poor contrast (dark text on dark backgrounds).

Updated components:

  • CustomOption.tsx - Added getOptionColors() helper function that applies dark mode background (#202839) on focus/hover and sets text color to white in dark mode
  • InlineMultiValue.tsx - Added dark mode detection and white text color for inline selected values
  • CustomMultiValue.tsx - Created getMultiValueColors() helper function to handle theme-aware colors for selected value chips when no custom color is provided

Code quality improvements:

  • Added no-nested-ternary: error ESLint rule to prevent future code complexity issues
  • Refactored color logic into helper functions following existing codebase patterns (similar to getTagColor() in Tag.tsx)

The fix ensures proper text contrast in dark mode while maintaining existing functionality in light mode and with custom colors (via colorMap prop).

How did you test this code?

Manual testing:

  1. Toggle dark mode on in the application settings

  2. Navigate Segments

  3. Steps to Reproduce:

  4. On Rules tab, add and And condition

  5. Select Environment Name, IN operator and then select and Environment.

  6. Verify inline selected values (e.g., "Production") display with white text and are clearly readable

  7. Open the MultiSelect dropdown

  8. Hover over options and verify they show dark background with white text

  9. Select multiple values and verify proper contrast

  10. Toggle back to light mode and verify no visual regressions

Expected results:

  • ✅ All text in MultiSelect is readable in dark mode
  • ✅ Focus/hover states have appropriate dark backgrounds
  • ✅ No visual regressions in light mode
  • ✅ Custom color functionality still works as expected

Before:

image

Now:
image

Closes #6315

talissoncosta and others added 2 commits November 21, 2025 11:57
- Add dark mode text and background colors to CustomOption, CustomMultiValue, and InlineMultiValue components
- Implement helper functions (getOptionColors, getMultiValueColors) following existing codebase patterns
- Add no-nested-ternary ESLint rule to prevent future code complexity issues
- Fix text contrast issues in dark mode for better accessibility

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@talissoncosta talissoncosta requested a review from a team as a code owner November 21, 2025 15:06
@talissoncosta talissoncosta requested review from Zaimwa9 and removed request for a team November 21, 2025 15:06
@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
flagsmith-frontend-preview Ready Ready Preview Comment Nov 21, 2025 3:06pm
flagsmith-frontend-staging Ready Ready Preview Comment Nov 21, 2025 3:06pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Ignored Ignored Nov 21, 2025 3:06pm

@github-actions github-actions Bot added front-end Issue related to the React Front End Dashboard fix labels Nov 21, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 21, 2025

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-6316 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-6316 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-6316 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-6316 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-6316 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-frontend:pr-6316 Finished ✅ Results

@talissoncosta talissoncosta merged commit 55cfd47 into main Nov 24, 2025
29 checks passed
@talissoncosta talissoncosta deleted the fix/dark-mode-styling-missing-for-multiselect-component branch November 24, 2025 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dark mode styling missing for MultiSelect component

2 participants