fix(search): Stop clear enter propagation

Signed-off-by: Carlos Esteban Lopez <lcarlosesteb@vmware.com>
This commit is contained in:
Carlos Esteban Lopez
2023-04-17 13:07:06 -05:00
committed by Carlos Lopez
parent d1ffbb5cce
commit 46310ee03f
2 changed files with 15 additions and 3 deletions
@@ -133,7 +133,17 @@ export const SearchBarBase: ForwardRefExoticComponent<SearchBarBaseProps> =
const endAdornment = (
<InputAdornment position="end">
<Button aria-label="Clear" size="small" onClick={handleClear}>
<Button
aria-label="Clear"
size="small"
onClick={handleClear}
onKeyDown={event => {
if (event.key === 'Enter') {
// write your functionality here
event.stopPropagation();
}
}}
>
Clear
</Button>
</InputAdornment>