mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Combobox: Call loadOptions with current input value when reopening menu (#95573)
This commit is contained in:
parent
048ba14c34
commit
fe4f44723d
@ -195,7 +195,7 @@ export const Combobox = <T extends string | number>({
|
||||
setItems(customValueOption ? [customValueOption, ...filteredItems] : filteredItems);
|
||||
},
|
||||
|
||||
onIsOpenChange: ({ isOpen }) => {
|
||||
onIsOpenChange: ({ isOpen, inputValue }) => {
|
||||
// Default to displaying all values when opening
|
||||
if (isOpen && !isAsync) {
|
||||
setItems(options);
|
||||
@ -204,7 +204,7 @@ export const Combobox = <T extends string | number>({
|
||||
|
||||
if (isOpen && isAsync) {
|
||||
setAsyncLoading(true);
|
||||
loadOptions('').then((options) => {
|
||||
loadOptions(inputValue ?? '').then((options) => {
|
||||
setItems(options);
|
||||
setAsyncLoading(false);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user