dataarts / dat.gui

Lightweight controller library for JavaScript.
Apache License 2.0
7.46k stars 1.08k forks source link

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

Open piepjaquet9 opened 3 years ago

piepjaquet9 commented 3 years ago

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();
  }
}