Support removing search terms
Summary: Project doc: https://docs.google.com/document/d/1miofxds9DJgWScj0zFyBbdpRH5Rj0T9FqiCapof5-vU Reviewed By: lblasa Differential Revision: D48557277 fbshipit-source-id: edaa5e8806538fa308d43c364e4f68967c1bf2ac
This commit is contained in:
committed by
Facebook GitHub Bot
parent
7061de44fe
commit
44c3f53905
@@ -14,6 +14,7 @@ import {
|
||||
FieldConfig,
|
||||
OperatorConfig,
|
||||
} from './PowerSearchTypes';
|
||||
import {CloseOutlined} from '@ant-design/icons';
|
||||
|
||||
export {PowerSearchConfig};
|
||||
|
||||
@@ -117,6 +118,20 @@ export const PowerSearch: React.FC<PowerSearchProps> = ({config}) => {
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<Button
|
||||
icon={<CloseOutlined />}
|
||||
onClick={() => {
|
||||
setSearchExpression((prevSearchExpression) => {
|
||||
if (prevSearchExpression[i]) {
|
||||
return [
|
||||
...prevSearchExpression.slice(0, i),
|
||||
...prevSearchExpression.slice(i + 1),
|
||||
];
|
||||
}
|
||||
return prevSearchExpression;
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</Space.Compact>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user