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

color:change fires before input:start #59

Closed
ywwg opened this issue Mar 26, 2019 · 4 comments
Closed

color:change fires before input:start #59

ywwg opened this issue Mar 26, 2019 · 4 comments
Assignees

Comments

@ywwg
Copy link

ywwg commented Mar 26, 2019

I'm using input:start and :end to disambiguate when the user makes a change vs when the color changes by code. When I see input:start, I set a boolean to indicate the user is interacting. When I see input:end, I turn it off. However due to the order of the events, this doesn't work. If I click on the color picker (at least on firefox), the events are:

  1. color:change
  2. input:start
  3. input:end

Steps 1 and 2 should be swapped.

I am able to work around this issue by manually calling my onColorChange handler inside my input:start handler, but this seems like something that should be fixed.

@jaames jaames self-assigned this Mar 26, 2019
@jaames
Copy link
Owner

jaames commented Mar 26, 2019

Hey! Thanks for flagging this issue

I agree that your suggested event order makes more sense, I've just pushed a hotfix (ver 4.2.2) which should fix that. 👍

It's worth noting that color:update also (intentionally) fires once with the initial color value too

@jaames
Copy link
Owner

jaames commented Apr 8, 2019

As of v4.3.0 there's now a built-in input:change event that should do exactly what you want -- it's identical to color:change except it only fires with user input.

@ile
Copy link

ile commented Sep 27, 2020

Hmm. Are you sure this works in the latest version (@jaames/iro@5.2.3).

I'm seeing input:start firing after input:change and it also fires twice in "component: iro.ui.Box". This happens, when I click just once in Box (on my development machine):

image

I'm seeing the wrong order in Slider too, but it fires just once.

@jaames
Copy link
Owner

jaames commented Sep 27, 2020

@ile this is a different issue, but yes it looks like you're right. I'll take a look after the weekend

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

No branches or pull requests

3 participants