Skip to content

Commit c5e0019

Browse files
committed
feat(input): enhance pointer event handling for interactive elements
Updated `handlePointerDown` to skip handling clicks on buttons and other interactive elements in addition to inputs and links. This prevents interference with the native behavior of such elements, ensuring a more consistent and user-friendly experience.
1 parent 40bab06 commit c5e0019

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/input/src/input.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ function Input(inputProps: ScopedProps<InputProps>): JSX.Element {
129129
const handlePointerDown: PointerEventHandler<HTMLDivElement> = (event) => {
130130
const target = event.target as HTMLElement;
131131

132-
// Skip handling when clicking directly on input or links
133-
// This prevents interference with native input/link behavior
134-
if (target.tagName.toLowerCase() === "input" || target.closest("input, a")) {
132+
// Skip handling when clicking directly on input, links, buttons, or other interactive elements
133+
// This prevents interference with native input/link/button behavior
134+
if (target.tagName.toLowerCase() === "input" || target.closest("input, a, button")) {
135135
event.stopPropagation();
136136

137137
return;

0 commit comments

Comments
 (0)