diff --git a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/CWSearchBar.tsx b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/CWSearchBar.tsx index 645f6960a6d..3dbbe318581 100644 --- a/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/CWSearchBar.tsx +++ b/packages/commonwealth/client/scripts/views/components/component_kit/new_designs/CWSearchBar/CWSearchBar.tsx @@ -84,11 +84,15 @@ export const CWSearchBar: FC = ({ const resetSearchBar = () => setSearchTerm(''); - const handleOnInput = (e: ChangeEvent) => + const handleOnInput = (e: ChangeEvent) => { + e.stopPropagation(); setSearchTerm(e.target.value); + }; const handleOnKeyUp = (e) => { + e.stopPropagation(); if (e.key === 'Enter') { + e.preventDefault(); handleGoToSearchPage(); if (size === 'small') { @@ -112,6 +116,7 @@ export const CWSearchBar: FC = ({ }; const handleOnKeyDown = (e: any) => { + e.stopPropagation(); if (e.key === 'Backspace' && searchTerm.length === 0) { setShowTag(false); }