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

Numeric input does not update min and max values #294

Open
onthez opened this issue May 4, 2021 · 1 comment
Open

Numeric input does not update min and max values #294

onthez opened this issue May 4, 2021 · 1 comment

Comments

@onthez
Copy link

onthez commented May 4, 2021

When updating the min and max values after a numeric slider control has been created, the slider updates appropriately with the new limits, but the input field continues to restrict the values to the initial min and max.

Here is a quick fiddle.
https://jsfiddle.net/ahqpmzLk/

Try inputting a number over 20 and it will be reduced to 20, but if you use the slider you can go up to 50.
Similarly when typing in a number between 0 and 10 it will jump to 10 even though the slider correctly allows lower values.

@Swampen
Copy link

Swampen commented May 30, 2021

Use the max() and min() functions on the controller instead. https://github.com/dataarts/dat.gui/blob/master/API.md#numbercontrollerminminvalue--datcontrollersnumbercontroller

control.min(0)
control.max(50)

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

2 participants