mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
fix NumControlBox to not firing onFinish with keyboard
This commit is contained in:
parent
8060842569
commit
dd5d0fc908
@ -64,13 +64,10 @@ class NumberControllerBox extends NumberController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onBlur() {
|
function onBlur() {
|
||||||
onChange();
|
onFinish();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMouseDrag(e) {
|
function onMouseDrag(e) {
|
||||||
// TODO.. why do we need to blur to update input value?
|
|
||||||
document.activeElement.blur();
|
|
||||||
|
|
||||||
const diff = prevY - e.clientY;
|
const diff = prevY - e.clientY;
|
||||||
_this.setValue(_this.getValue() + diff * _this.__impliedStep);
|
_this.setValue(_this.getValue() + diff * _this.__impliedStep);
|
||||||
|
|
||||||
@ -113,7 +110,6 @@ class NumberControllerBox extends NumberController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateDisplay() {
|
updateDisplay() {
|
||||||
if (dom.isActive(this.__input)) return this; // prevent number from updating if user is trying to manually update
|
|
||||||
this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);
|
this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);
|
||||||
return super.updateDisplay();
|
return super.updateDisplay();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user