Skip to content
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

Make colorpicker field use HTML5 native color picker #3387

Merged
merged 1 commit into from
Sep 16, 2021

Conversation

jdufresne
Copy link
Member

This removes the jquery.colorpicker.js dependency, reducing the overall
size of compiled assets.

The native color input element is builtin and so will have better a11y
support. It allows the browser, device, or a11y technology to present a
UI to the user to select a color. The value submitted by the form is a 6
digit hex, same as before.

Beyond the advantage of using a native UI element, this helps move
towards removing jQuery as a dependency or at least reducing its usage.

For additional details on the color input element, see:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input/color

Uses Rails color_field for rendering:
https://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-color_field

Refs #2893

This removes the jquery.colorpicker.js dependency, reducing the overall
size of compiled assets.

The native color input element is builtin and so will have better a11y
support. It allows the browser, device, or a11y technology to present a
UI to the user to select a color. The value submitted by the form is a 6
digit hex, same as before.

Beyond the advantage of using a native UI element, this helps move
towards removing jQuery as a dependency or at least reducing its usage.

For additional details on the color input element, see:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input/color

Uses Rails color_field for rendering:
https://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-color_field

Refs railsadminteam#2893
@mshibuya mshibuya merged commit a480836 into railsadminteam:master Sep 16, 2021
@mshibuya
Copy link
Member

Amazing work, thanks!

@jdufresne jdufresne deleted the color-picker branch September 18, 2021 18:09
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.

2 participants