Skip to content

Commit 7d29009

Browse files
committed
fix: unit tests
1 parent f2341ae commit 7d29009

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

packages/pluggableWidgets/datagrid-dropdown-filter-web/src/components/__tests__/DataGridDropdownFilter.spec.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ const commonProps = {
2222
groupKey: "dropdown-filter",
2323
filterable: false,
2424
clearable: true,
25+
emptyOptionCaption: dynamicValue("None"),
26+
emptySelectOptionCaption: dynamicValue("Select"),
2527
selectionMethod: "checkbox" as const,
2628
selectedItemsStyle: "text" as const
2729
};

packages/shared/widget-plugin-filtering/src/controls/combobox/Combobox.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ const cls = classes();
2626

2727
export const Combobox = observer(function Combobox(props: ComboboxProps) {
2828
const inputRef = useRef<HTMLInputElement>(null);
29-
const { isOpen, highlightedIndex, getInputProps, getToggleButtonProps, getMenuProps, getItemProps } = useCombobox(
30-
props.useComboboxProps()
31-
);
29+
const { isOpen, highlightedIndex, getInputProps, getToggleButtonProps, getMenuProps, getItemProps, getLabelProps } =
30+
useCombobox(props.useComboboxProps());
3231

3332
const { refs, floatingStyles } = useFloatingMenu(isOpen);
3433

@@ -40,10 +39,12 @@ export const Combobox = observer(function Combobox(props: ComboboxProps) {
4039
data-empty={props.empty ? true : undefined}
4140
style={props.style}
4241
>
42+
<div className={"sr-only"} {...getLabelProps()}>
43+
{props.emptyCaption}
44+
</div>
4345
<input
4446
className={cls.input}
4547
{...getInputProps({
46-
"aria-label": props.inputPlaceholder || "Search",
4748
ref: inputRef,
4849
onBlur: props.onBlur,
4950
onFocus: props.onFocus,

0 commit comments

Comments
 (0)