diff --git a/dat-gui/dat-gui-tests.ts b/dat-gui/dat-gui-tests.ts index cd71e2471b..19b34dd43f 100644 --- a/dat-gui/dat-gui-tests.ts +++ b/dat-gui/dat-gui-tests.ts @@ -157,3 +157,19 @@ var FizzyText = function () { update(); } +// ------------ 11. Object Literal Tests +() => { + var obj = {a:1,b:1}; + var gui = new dat.GUI(); + var controller = gui.add(obj, 'maxSize', 0, 10); + + controller.onChange(function (value) { + // Fires on every change, drag, keypress, etc. + }); + + controller.onFinishChange(function (value) { + // Fires when a controller loses focus. + alert("The new value is " + value); + }); +} +