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

Stepped number controllers generating extra onChange events #125

Closed
Sceat opened this issue Nov 13, 2023 · 6 comments
Closed

Stepped number controllers generating extra onChange events #125

Sceat opened this issue Nov 13, 2023 · 6 comments
Labels
bug Something isn't working
Milestone

Comments

@Sceat
Copy link

Sceat commented Nov 13, 2023

to reproduce:

      gui
        .add({ count: 1 }, 'count', 1, 5, 1)
        .name('count')
        .onChange(count => {
          console.log('change', count)
        })

Originally posted by @Sceat in #124 (comment)

@georgealways
Copy link
Owner

Thanks for this. I'm able to reproduce, but to confirm, it seems like this only affects number sliders with a step?

@Sceat
Copy link
Author

Sceat commented Nov 15, 2023

most probably yes

@georgealways georgealways added this to the 0.19.1-dev milestone Nov 29, 2023
@georgealways georgealways added the bug Something isn't working label Nov 29, 2023
@georgealways georgealways changed the title onChange is triggered even when values are not changing Stepped number controllers generating extra onChange events Nov 29, 2023
@psnet
Copy link

psnet commented Feb 29, 2024

I can confirm this right in the off docs example:

https://lil-gui.georgealways.com/#Guide#Numbers-and-Sliders

  • If you put cursor in field
    зображення

  • scroll mouse wheel in any direction, example up
    зображення

  • step will be not 10 as set by step() method, but 1130

  • if scroll mouse wheel backward it will be default value again (i.e. offset / step is not calculated correctly, but calc for + and - is ok)
    зображення

@psnet
Copy link

psnet commented Feb 29, 2024

I can confirm this for number input fields and for sliders too

@georgealways
Copy link
Owner

Hi @psnet, I'm not sure if this was intentional but it appears to be a duplicate of your comment on another issue: #46 (comment)

As for extra onChange events, there will be a fix for this issue in the next release.

@georgealways
Copy link
Owner

Hi all, this issue is fixed as of 0.19.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants