Skip to content

Color Picker: Hide swatches when empty #1080

Closed
@enkelmedia

Description

@enkelmedia

Which exact UI Library version are you using? For example: 1.0.1 - don't just write v1.

1.13.0

Bug summary

Today the color picker checks that the swatches-property has a value before rendering swatches in the picker. However, the type definition does not allow setting swatches to null.

Specifics

I thinking that we should either allow setting swatches to null or check if the array is empty on this line:

if (!this.swatches) return nothing;

Steps to reproduce

Try setting uui-color-pickers swatches-property to a empty array. Notice that the swatches are still shown, set it to null - notice the type error.

Expected result / actual result

Should be possible to hide swatches by setting the value to null or by passing an empty array.

Happy to provide PR depending on the approach that you would like to take 😊

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcommunity/up-for-grabsneeds triageThis issue has not been tested by a team member yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions