mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
#179 : Cannot update NumberControllerBox with .listen() fix
(cherry picked from commit fa20388
)
This commit is contained in:
parent
4dd9c866b7
commit
8bbddc7bbe
@ -108,6 +108,10 @@ class NumberControllerBox extends NumberController {
|
||||
}
|
||||
|
||||
updateDisplay() {
|
||||
if(this.__input === document.activeElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);
|
||||
return super.updateDisplay();
|
||||
}
|
||||
|
@ -109,6 +109,9 @@ class NumberControllerSlider extends NumberController {
|
||||
}
|
||||
|
||||
updateDisplay() {
|
||||
if(this.__input === document.activeElement) {
|
||||
return;
|
||||
}
|
||||
const pct = (this.getValue() - this.__min) / (this.__max - this.__min);
|
||||
this.__foreground.style.width = pct * 100 + '%';
|
||||
return super.updateDisplay();
|
||||
|
Loading…
Reference in New Issue
Block a user