-
Couldn't load subscription status.
- Fork 2.8k
Add option to hide colors from icon picker #20650
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
base: main
Are you sure you want to change the base?
Conversation
|
Hi there @bjarnef, thank you for this contribution! 👍 While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds the ability to hide the color picker section in the icon picker modal, restoring functionality that existed in the old backoffice UI. This allows developers to programmatically hide colors when opening the icon picker modal by setting hideColors: true in the modal data.
Key Changes:
- Added
hideColorsproperty to the icon picker property editor and modal interfaces - Refactored color picker rendering into a conditional
renderColors()method
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| property-editor-ui-icon-picker.element.ts | Adds hideColors property and passes it to the modal data |
| icon-picker-modal.token.ts | Extends modal data interface with optional hideColors boolean field |
| icon-picker-modal.element.ts | Refactors color picker rendering into conditional method that respects hideColors flag |
| ${umbFocus()}> | ||
| <uui-icon name="search" slot="prepend" id="search_icon"></uui-icon> | ||
| </uui-input> | ||
| <hr /> |
Copilot
AI
Oct 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The <hr /> separator after the search input should only render when colors are visible. Currently, it renders even when hideColors is true, creating an unnecessary visual separator. Move this line inside the renderColors() method before the color swatches to ensure it only appears when colors are shown.
| } | ||
|
|
||
| renderColors() { | ||
| return this.data?.hideColors === true |
Copilot
AI
Oct 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The explicit === true comparison is redundant since hideColors is already a boolean. Simplify to return this.data?.hideColors ? nothing : html\...` for cleaner code.
| return this.data?.hideColors === true | |
| return this.data?.hideColors |
Prerequisites
If there's an existing issue for this PR then this fixes
Description
This PR fix part of the discussion in #20647 and add the option to hide colors from icon picker, which was previously available in the old backoffice UI: #13079
It would be great if we furthermore can pass in an arrray of color/swatch modal to override the
umbracoColorsarray, but I still think it is useful explicit to hide colors even though colors may be defined.Example:
or via configuration of
Umb.PropertyEditorUi.IconPicker.