Skip to content

FIX: improve color input hex autocomplete #34218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 12, 2025
Merged

Conversation

dbattersby
Copy link
Contributor

@dbattersby dbattersby commented Aug 11, 2025

The color input component autocompletes hex patterns to update 3 character codes to 6 characters. However we should only attempt to format common patterns, and don't intervene for non sequenced values. For example, we can:

  • change eee to eeeeee
  • change f2f to f2f2f2
  • skip non sequenced patterns like 0f8 and allow the user to complete manually

@dbattersby dbattersby marked this pull request as ready for review August 12, 2025 13:53
…color-input-test.gjs

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
@dbattersby dbattersby merged commit 3c82f1b into main Aug 12, 2025
16 checks passed
@dbattersby dbattersby deleted the color-input-hex-autocomplete branch August 12, 2025 14:41
dbattersby added a commit that referenced this pull request Aug 13, 2025
This change allows users to update category text color without
autocompleting the input value. Instead we are using `onBlur` to allow
the normalized hex value to be updated when the using submits or
tabs/clicks out of the field.

We are also restoring the normalized hex back to the correct value - for
example`f8f` becomes `ff88ff` if using only 3 digits. This was
mistakenly changed in #34218 to improve auto complete in the edit
category page but it affects the color pickers in other parts of the app
too.

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants