dataarts / dat.gui

Lightweight controller library for JavaScript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Numeric input does not update min and max values

onthez opened this issue · comments

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.

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)