mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-02-11 14:20:07 +08:00
fix(blocks-antd): Added debounce condition to Selector and MultipleSelector
This commit is contained in:
parent
28b9ebdbf1
commit
910bee0837
@ -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