Remove last search term on backspace press when term finder is empty
Summary: Project doc: https://docs.google.com/document/d/1miofxds9DJgWScj0zFyBbdpRH5Rj0T9FqiCapof5-vU Reviewed By: lblasa Differential Revision: D48637890 fbshipit-source-id: fb952ffe1ab1a94d2bc465b89be6c62a71be9b9f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
52a4051b15
commit
7b9ddb617f
@@ -146,6 +146,14 @@ export const PowerSearch: React.FC<PowerSearchProps> = ({
|
||||
},
|
||||
]);
|
||||
}}
|
||||
onBackspacePressWhileEmpty={() => {
|
||||
setSearchExpression((prevSearchExpression) => {
|
||||
return prevSearchExpression.slice(
|
||||
0,
|
||||
prevSearchExpression.length - 1,
|
||||
);
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</PowerSearchContainer>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user