dataarts / dat.gui

Lightweight controller library for JavaScript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ColorController: onFinishChange is not called when editing the color text field

piepjaquet9 opened this issue · comments

commented

The onFinishChange callback does not fire when changing the color by typing in a new value in the text field.

A call to onFinish should be added to onBlur:

function onBlur() {
  const i = interpret(this.value);
  if (i !== false) {
    _this.__color.__state = i;
    _this.setValue(_this.__color.toOriginal());
    // Added onFinish call
    onFinish();
  } else {
    this.value = _this.__color.toString();
  }
}