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

Color field: disable spectrum, merge pickerOptions, refactor #4820

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

stuartromanek
Copy link
Member

@stuartromanek stuartromanek commented Dec 12, 2024

Summary

  • Adds support for disabling the color spectrum UI of a color field
  • Adds module level default options for color pickers
  • Refactors portions of the implementation of color pickers by schemas and RT widgets
  • Removes pickerOptions from the options API and moves its properties up a level

old:

options: {
  format: 'hex6',
  pickerOptions: {
    disableFields: true,
    presetColors: [ '#fff', '#000' ]
  }
}

new:

options: {
  format: 'hex6',
  disableFields: true,
  presetColors: [ '#fff', '#000' ]
}
  • Fixes an issue where the RT control bar would close while using the color picker
  • Fixes an issue where clicking the color picker's hue field wouldn't update

Tests

UI tests passing

What are the specific steps to test this change?

For example:

  1. checkout public-demo#color-options-demo
  2. Boot up, log on
  3. Create a new Topic.
  4. Make sure Fun Fields > Color has it's color spectrum disabled when picking
  5. On any page, create a rich text widget. Use the color tool to color text. See that it is just a set of preset swatches.

What kind of change does this PR introduce?

(Check at least one)

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build-related changes
  • Other

Make sure the PR fulfills these requirements:

  • It includes a) the existing issue ID being resolved, b) a convincing reason for adding this feature, or c) a clear description of the bug it resolves
  • The changelog is updated
  • Related documentation has been updated
  • Related tests have been updated

If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

@stuartromanek stuartromanek marked this pull request as ready for review December 13, 2024 13:20
Copy link
Contributor

@BoDonkey BoDonkey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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