Skip to content

add new check on alpha to check if undefined #1061

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 4 commits into
base: v1/contrib
Choose a base branch
from

Conversation

Welander1994
Copy link
Contributor

Adds checks to this.alpha

Description

Added a new check in to alpha to check if the value for the color picker is defined or not.
if the value is undefined, it will default the alpha to 100

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)

Motivation and context

This is to improve the UX for when user is picking a new color

How to test?

Using the eye dropper color picker data type, when on a content node of the content tree, if you click on the round colour selection palette to change the colour, you will see that the default opacity is 100 now

Screenshots (if appropriate)

Checklist

  • If my change requires a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@nielslyngsoe nielslyngsoe enabled auto-merge (squash) April 4, 2025 06:58
@@ -379,7 +379,7 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) {
this.hue = h;
this.saturation = s;
this.lightness = l;
this.alpha = this.opacity ? a * 100 : 100;
this.alpha = this.opacity != undefined ? a * 100 : 100;
Copy link
Contributor

@bjarnef bjarnef Apr 7, 2025

Choose a reason for hiding this comment

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

Not sure how opacity can be undefined? It's a boolean property with false as default value.

In the story it set value: undefined.

I guess it is more likely a from parsed color which is undefined or null, if value property is defined/null.

Copy link
Contributor

@iOvergaard iOvergaard left a comment

Choose a reason for hiding this comment

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

I think @bjarnef has a point here and would like to get it investigated before merging.

@iOvergaard iOvergaard added the bug Something isn't working label Apr 11, 2025
Copy link

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

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.

4 participants