color-js / elements

WIP
13 stars 1 forks source link

[Custom Events] On user interaction every event fires twice with the same value #26

Closed DmitrySharabin closed 5 months ago

DmitrySharabin commented 6 months ago

Even though all of them fire once during an element initialization.

For example, we have the following for <color-slider>.

On initialization

image

On user interaction

image

Testcase

<color-slider space="hsl" stops="oklch(90% 50% 100), darkcyan, indigo" id="slider"></color-slider>
<script>
    slider.addEventListener("colorchange", console.log);
    slider.addEventListener("valuechange", console.log);
</script>
DmitrySharabin commented 5 months ago

Not an issue anymore.