Add mouse down listener in PreventSelectingEntry (#24665)

GitOrigin-RevId: 97411fd45d10b850f41c3f6269550bc6fffb0e11
This commit is contained in:
Domagoj Kriskovic
2025-04-07 14:27:38 +02:00
committed by Copybot
parent d08fa01110
commit 0f3f78cde7

View File

@@ -1,5 +1,7 @@
const stopPropagation = (e: React.FocusEvent | React.MouseEvent) =>
const stopPropagation = (e: React.FocusEvent | React.MouseEvent) => {
e.stopPropagation()
e.preventDefault()
}
export const PreventSelectingEntry = ({
children,
@@ -8,7 +10,11 @@ export const PreventSelectingEntry = ({
}) => {
return (
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
<div onFocus={stopPropagation} onMouseUp={stopPropagation}>
<div
onMouseDown={stopPropagation}
onFocus={stopPropagation}
onMouseUp={stopPropagation}
>
{children}
</div>
)