Skip to content

Commit

Permalink
stop-prop-input-clear (#1848)
Browse files Browse the repository at this point in the history
Co-authored-by: Naman Goel <namagoel@cisco.com>
  • Loading branch information
NamanGoel20 and namagoel authored Dec 12, 2024
1 parent 5959d21 commit 88e26e1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web-components/src/components/input/Input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,13 @@ export namespace Input {
}

handleClear(event: MouseEvent | KeyboardEvent) {
event.preventDefault();
event.stopPropagation();
if (event.type === "keydown") {
const { code } = event as KeyboardEvent;
if (code !== Key.Space && code !== Key.Enter) {
return;
}
event.preventDefault();
}
this.input.focus();
this.dispatchEvent(
Expand Down

0 comments on commit 88e26e1

Please sign in to comment.