mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
MultiSelect: Respect value passed to the component regardless of custom value being allowed or not (#87906)
* MultiSelect: Respect value passed to the component regardless of custom value being allowed or not * reset input for test --------- Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
This commit is contained in:
parent
953c8f838f
commit
fa63e03df3
@ -186,7 +186,7 @@ export function SelectBase<T, Rest = {}>({
|
|||||||
const selectableValue = findSelectedValue(v.value ?? v, options);
|
const selectableValue = findSelectedValue(v.value ?? v, options);
|
||||||
// If the select allows custom values there likely won't be a selectableValue in options
|
// If the select allows custom values there likely won't be a selectableValue in options
|
||||||
// so we must return a new selectableValue
|
// so we must return a new selectableValue
|
||||||
if (!allowCustomValue || selectableValue) {
|
if (selectableValue) {
|
||||||
return selectableValue;
|
return selectableValue;
|
||||||
}
|
}
|
||||||
return typeof v === 'string' ? toOption(v) : v;
|
return typeof v === 'string' ? toOption(v) : v;
|
||||||
|
@ -189,6 +189,8 @@ describe('AlertGroups', () => {
|
|||||||
renderAmNotifications();
|
renderAmNotifications();
|
||||||
await waitForElementToBeRemoved(ui.loadingIndicator.query());
|
await waitForElementToBeRemoved(ui.loadingIndicator.query());
|
||||||
|
|
||||||
|
// reset the input of the MultiSelect component
|
||||||
|
await user.type(ui.groupByInput.get(), '{backspace}');
|
||||||
await user.type(ui.groupByInput.get(), 'appName{enter}');
|
await user.type(ui.groupByInput.get(), 'appName{enter}');
|
||||||
|
|
||||||
const groups = await ui.group.findAll();
|
const groups = await ui.group.findAll();
|
||||||
|
Loading…
Reference in New Issue
Block a user