Skip to content

fix(uui-color-slider): sets max = 360 for hue type #1149

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leekelleher
Copy link
Member

Description

Extends the range of the hue slider in the UUI Color Picker component.

Fixes umbraco/Umbraco-CMS#19620.

PR #1076 added nullable fallbacks for the max value for the different types, (ref). Which for the hue type doesn't account for the initial max value of 100, meaning it wouldn't fallback to 360 by default.

The previous implementation fixed the max value to 360, so I've reverted the code to this.

Types of changes

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

How to test?

Open a Color Picker component, in the hue slider, extend to over a value of 100, so that you can scroll through the spectrum of colours (from red to red).

@leekelleher leekelleher added the bug Something isn't working label Jul 14, 2025
@Copilot Copilot AI review requested due to automatic review settings July 14, 2025 14:28
Copy link
Contributor

@Copilot Copilot AI left a 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 restores the fixed maximum value for the hue slider in the UUI Color Picker by always setting max to 360 when type is 'hue', ensuring the full color spectrum is exposed.

  • Always assign max = 360 for hue (no nullable fallback)
  • Reverts the conditional fallback added in PR #1076 for hue
Comments suppressed due to low confidence (1)

packages/uui-color-slider/lib/uui-color-slider.element.ts:110

  • Add a unit test to verify that the hue slider's max is correctly set to 360 when type is 'hue', ensuring the full spectrum is available.
        this.max = 360;

Copy link

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-1149.westeurope.azurestaticapps.net

@bjarnef
Copy link
Contributor

bjarnef commented Jul 14, 2025

I think this need to simular at the other types - not just hue :)

It makes sense hue value is between 0-360, but perhaps someone want to use alpha slider between 0-50 or 50-100.

Ideally these can use clamp function to ensure a min or max lower/higher than expected value can't be configured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

V16 Colorpicker - colorslider doesn't have enough range
2 participants