From db3ea4c464ae5f86dd1ce2320c6f8a4fa6a874d4 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Mon, 25 Jan 2021 19:22:04 -0600 Subject: [PATCH] =?UTF-8?q?fix(search):=20=F0=9F=90=9B=20implement=20new?= =?UTF-8?q?=20close=20dropdown=20param?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref https://github.com/ant-design/ant-design/pull/28688 --- web/src/hooks/useSearchColumnFilter.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/web/src/hooks/useSearchColumnFilter.tsx b/web/src/hooks/useSearchColumnFilter.tsx index 41872bd8b7..130e283e78 100644 --- a/web/src/hooks/useSearchColumnFilter.tsx +++ b/web/src/hooks/useSearchColumnFilter.tsx @@ -1,7 +1,10 @@ import { SearchOutlined } from "@ant-design/icons"; import { Button, Input } from "antd"; import React, { useEffect, useState } from "react"; -import { FilterDropdownProps } from "antd/lib/table/interface"; +import { + FilterConfirmProps, + FilterDropdownProps, +} from "antd/lib/table/interface"; interface FilterPropsState { filterDropdown?: @@ -18,8 +21,8 @@ export const useSearchColumnFilter = (dataIndex: string) => { onFilter: undefined, }); useEffect(() => { - const handleSearch = (confirm?: () => void) => { - confirm && confirm(); + const handleSearch = (confirm?: (param: FilterConfirmProps) => void) => { + confirm && confirm({ closeDropdown: true }); }; const handleReset = (clearFilters?: (selectedKeys: string[]) => void) => { clearFilters && clearFilters([]);