Преглед на файлове

Add mouse down listener in PreventSelectingEntry (#24665)

GitOrigin-RevId: 97411fd45d10b850f41c3f6269550bc6fffb0e11
Domagoj Kriskovic преди 1 година
родител
ревизия
0f3f78cde7
променени са 1 файла, в които са добавени 8 реда и са изтрити 2 реда
  1. 8 2
      services/web/frontend/js/features/review-panel-new/components/review-panel-prevent-selecting.tsx

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