mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-02-17 14:30:34 +08:00
Merge pull request #1004 from lowdefy/selector-search-bounce
fix(blocks-antd): Added debounce condition to Selector and MultipleSelector.
This commit is contained in:
commit
8f44e1a2ff
@ -110,8 +110,10 @@ const MultipleSelector = ({
|
||||
}}
|
||||
onSearch={async (value) => {
|
||||
setFetch(true);
|
||||
await methods.triggerEvent({ name: 'onSearch', event: { value } });
|
||||
setFetch(false);
|
||||
const result = await methods.triggerEvent({ name: 'onSearch', event: { value } });
|
||||
if (!result.bounced) {
|
||||
setFetch(false);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{uniqueValueOptions.map((opt, i) =>
|
||||
|
@ -98,8 +98,10 @@ const Selector = ({
|
||||
}}
|
||||
onSearch={async (value) => {
|
||||
setFetch(true);
|
||||
await methods.triggerEvent({ name: 'onSearch', event: { value } });
|
||||
setFetch(false);
|
||||
const result = await methods.triggerEvent({ name: 'onSearch', event: { value } });
|
||||
if (!result.bounced) {
|
||||
setFetch(false);
|
||||
}
|
||||
}}
|
||||
value={getValueIndex(value, uniqueValueOptions)}
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user