Skip to content
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

show-alpha attribute #2

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

show-alpha attribute #2

wants to merge 1 commit into from

Conversation

simshaun
Copy link

@simshaun simshaun commented Aug 8, 2024

Hi,

Thank you for this library. I'm swapping out a heavier color picker library for this one and need the ability to hide the alpha controls.

This PR allows for that by introducing a show-alpha attribute. (defaults to true to protect backwards-compatibility)

@@ -180,7 +183,7 @@ class ColorPicker extends HTMLElement {
const scope = this;
this.state = new Proxy(scope.stateDefaults, {
// eslint-disable-next-line
set(target: IColorPickerState, key: string | symbol, value: any, _receiver: any): boolean {
set(target: IColorPickerState, key: keyof IColorPickerState, value: any, _receiver: any): boolean {
Copy link
Author

Choose a reason for hiding this comment

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

This is an unrelated change but protects against using an invalid key name below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant