Skip to content

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 AI review requested due to automatic review settings July 14, 2025 14:28
Copy link
Contributor

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;

@github-actions
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 be 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.

@leekelleher leekelleher requested a review from iOvergaard August 5, 2025 11:42
@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 5, 2025

@github-actions
Copy link

github-actions bot commented Aug 5, 2025

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

@iOvergaard iOvergaard merged commit d7aeb38 into main Aug 5, 2025
11 of 12 checks passed
@iOvergaard iOvergaard deleted the v1/bugfix/color-slider-hue-max branch August 5, 2025 12:36
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

4 participants