Skip to content

Change the jscolor format to HEX instead of HEXA #148

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 2 commits into from
Oct 3, 2021
Merged

Change the jscolor format to HEX instead of HEXA #148

merged 2 commits into from
Oct 3, 2021

Conversation

Rocksheep
Copy link
Contributor

Description

I changed a jscolor configuration where the format was set as HEXA instead of HEX.

Fixes #145

Type of change

  • Bug fix (added a non-breaking change which fixes an issue)

How Has This Been Tested?

  • Tested locally with a valid username
  • Tested locally with an invalid username
  • Ran tests with composer test
  • Added or updated test cases to test new features

Checklist:

  • I have checked to make sure no other pull requests are open for this issue
  • The code is properly formatted and is consistent with the existing code style
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Screenshots

@DenverCoder1
Copy link
Owner

I want the site to still support hexa colors, just that when you input a hex color, it should display as hex to look cleaner. It already hides it on input (#137), but not if you use keyboard input.

@Rocksheep
Copy link
Contributor Author

Ah alright, so you just always want it to be removed when it's FF?

@DenverCoder1
Copy link
Owner

Yeah, if you click away from the input box when it is 9 characters (# and 8 hex digits) and ends with FF, it should change it to just the first 7 characters (# and 6 hex digits) without the FF.

@Rocksheep
Copy link
Contributor Author

I have added an onChange method on the jscolor configuration that uses the same function as the onInput function. This fixed it for me.

@DenverCoder1
Copy link
Owner

That looks good. 👍 I'm thinking maybe we could just use onChange instead of onInput. That way the user will still be able to type normally in the field (onInput seems to prevent that).

@Rocksheep
Copy link
Contributor Author

Yeah I could do that, but then you get this while using the colorpicker. So it's your call!

Screen.Recording.2021-10-03.at.15.04.40.mov

@DenverCoder1
Copy link
Owner

Yeah, it's a tough call. I think it's fine as is then.

@DenverCoder1
Copy link
Owner

Thanks again for your contributions!

@DenverCoder1 DenverCoder1 merged commit 6f7bedc into DenverCoder1:main Oct 3, 2021
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.

Color picker adds FF when colors are typed into the color picker
2 participants