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

Update value even if color is not correct #37

Open
Marfru opened this issue May 9, 2022 · 0 comments
Open

Update value even if color is not correct #37

Marfru opened this issue May 9, 2022 · 0 comments

Comments

@Marfru
Copy link

Marfru commented May 9, 2022

Greetings,

I have an issue, I noticed that the color change function fires up only when the color is valid.

Is there a way to fire it up even if the inputted data is not a valid color?

For example, in the console.log(this.selectedColor), it only fires when the color is valid. Let's say I add #xxx87, it doesn't fire up. Is it possible to make it available even when the data is not a valid color?

if (!this.colorSelector) {
        const elem = this.$el.querySelector('.brand-color-input')
        this.colorSelector = new Huebee(elem,{
          notation: 'hex',
          saturations: 2,
        })
        this.colorSelector.on('change', (color) => {
          this.selectedColor = color
          this.colorIcon = elem.style.color
          this.$emit('input', this.selectedColor)
          console.log(this.selectedColor)
        })
      }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant