Skip to content

Commit b2263fb

Browse files
committed
chore(platform): emit onSearchClick when keydown Enter
1 parent 4897e7c commit b2263fb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/platform/src/app/components/table-filter/TableFilter.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ export function AppTableFilter(props: AppTableFilterProps): JSX.Element | null {
5858
className="app-table-filter__search-input"
5959
dModel={searchValue}
6060
dPlaceholder={aSearchPlaceholder}
61+
dInputRender={(el) =>
62+
React.cloneElement<React.InputHTMLAttributes<HTMLInputElement>>(el, {
63+
onKeyDown: (e) => {
64+
el.props.onKeyDown?.(e);
65+
66+
if (e.code === 'Enter') {
67+
e.preventDefault();
68+
onSearchClick?.();
69+
}
70+
},
71+
})
72+
}
6173
onModelChange={changeSearchValue}
6274
/>
6375
<div className="app-table-filter__button-container">

0 commit comments

Comments
 (0)