Explorar o código

Add mouse down listener in PreventSelectingEntry (#24665)

GitOrigin-RevId: 97411fd45d10b850f41c3f6269550bc6fffb0e11
Domagoj Kriskovic hai 1 ano
pai
achega
0f3f78cde7

+ 8 - 2
services/web/frontend/js/features/review-panel-new/components/review-panel-prevent-selecting.tsx

@@ -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>
   )