Skip to content

Commit d271f31

Browse files
committed
feat: add debounce interval property to combobox
1 parent 396cdff commit d271f31

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

packages/pluggableWidgets/combobox-web/src/Combobox.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,11 @@
337337
<actionVariable key="filterInput" caption="Filter Input" type="String" />
338338
</actionVariables>
339339
</property>
340+
341+
<property key="debounceInterval" type="integer" required="true" defaultValue="200">
342+
<caption>Debounce interval</caption>
343+
<description>The debounce interval in milliseconds.</description>
344+
</property>
340345
</propertyGroup>
341346
<propertyGroup caption="Accessibility">
342347
<propertyGroup caption="Accessibility">

packages/pluggableWidgets/combobox-web/src/hooks/useGetSelector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function useGetSelector(props: ComboboxContainerProps): Selector {
2525
() =>
2626
debounce((filterValue?: string) => {
2727
onInputValueChange(props.onChangeFilterInputEvent, filterValue);
28-
}, 200),
28+
}, props.debounceInterval ?? 200),
2929
[props.onChangeFilterInputEvent]
3030
);
3131

packages/pluggableWidgets/combobox-web/typings/ComboboxProps.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export interface ComboboxContainerProps {
9090
onEnterEvent?: ActionValue;
9191
onLeaveEvent?: ActionValue;
9292
onChangeFilterInputEvent?: ActionValue<{ filterInput: Option<string> }>;
93+
debounceInterval: number;
9394
ariaRequired: DynamicValue<boolean>;
9495
ariaLabel?: DynamicValue<string>;
9596
clearButtonAriaLabel?: DynamicValue<string>;
@@ -147,6 +148,7 @@ export interface ComboboxPreviewProps {
147148
onEnterEvent: {} | null;
148149
onLeaveEvent: {} | null;
149150
onChangeFilterInputEvent: {} | null;
151+
debounceInterval: number | null;
150152
ariaRequired: string;
151153
ariaLabel: string;
152154
clearButtonAriaLabel: string;

0 commit comments

Comments
 (0)