mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 21:27:52 +00:00
[Summary Widgets] Adding a new condition to a rule deletes the input value from previous ones #2411 (#2481)
* [Summary Widgets] Adding a new condition to a rule deletes the input value from previous ones #2411 * Summary Widget Rule conditions not persisting numeric values #2491
This commit is contained in:
parent
43515ca84e
commit
5dbd77d10c
@ -180,7 +180,7 @@ define([
|
||||
|
||||
inputArea.html('');
|
||||
this.valueInputs = [];
|
||||
this.config.values = [];
|
||||
this.config.values = this.config.values || [];
|
||||
|
||||
if (evaluator.getInputCount(operation)) {
|
||||
inputCount = evaluator.getInputCount(operation);
|
||||
@ -191,8 +191,10 @@ define([
|
||||
newInput = $('<select>' + this.generateSelectOptions() + '</select>');
|
||||
emitChange = true;
|
||||
} else {
|
||||
this.config.values[index] = inputType === 'number' ? 0 : '';
|
||||
newInput = $('<input type = "' + inputType + '" value = "' + this.config.values[index] + '"> </input>');
|
||||
const defaultValue = inputType === 'number' ? 0 : '';
|
||||
const value = this.config.values[index] || defaultValue;
|
||||
this.config.values[index] = value;
|
||||
newInput = $('<input type = "' + inputType + '" value = "' + value + '"></input>');
|
||||
}
|
||||
|
||||
this.valueInputs.push(newInput.get(0));
|
||||
|
Loading…
Reference in New Issue
Block a user