mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 12:14:08 -06:00
Dashboard scenes: fix textbox value only set to first character of default value (#86595)
Dashboard scene: fix textbox value only set to first character in default value
This commit is contained in:
parent
357276da01
commit
dccad4e081
@ -392,9 +392,20 @@ export function createSceneVariableFromVariableModel(variable: TypedVariableMode
|
||||
hide: variable.hide,
|
||||
});
|
||||
} else if (variable.type === 'textbox') {
|
||||
let val;
|
||||
if (!variable?.current?.value) {
|
||||
val = variable.query;
|
||||
} else {
|
||||
if (typeof variable.current.value === 'string') {
|
||||
val = variable.current.value;
|
||||
} else {
|
||||
val = variable.current.value[0];
|
||||
}
|
||||
}
|
||||
|
||||
return new TextBoxVariable({
|
||||
...commonProperties,
|
||||
value: variable?.current?.value?.[0] ?? variable.query,
|
||||
value: val,
|
||||
skipUrlSync: variable.skipUrlSync,
|
||||
hide: variable.hide,
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user