EnxDev commented on code in PR #36889:
URL: https://github.com/apache/superset/pull/36889#discussion_r3635468760


##########
superset-frontend/src/dashboard/components/gridComponents/TabsRenderer/TabsRenderer.test.tsx:
##########
@@ -199,4 +201,24 @@ describe('TabsRenderer', () => {
     expect(screen.getByText('Tab 1 Content')).toBeInTheDocument();
     expect(screen.queryByText('Tab 2 Content')).not.toBeInTheDocument(); // 
Not active
   });
+
+  test('activates dragging when the pointer starts on a tab title input', () 
=> {
+    // Tab titles render a textarea that covers most of the tab in edit mode
+    const textarea = document.createElement('textarea');
+    document.body.appendChild(textarea);
+    const nativeEvent = new MouseEvent('pointerdown', { button: 0 });
+    Object.defineProperty(nativeEvent, 'isPrimary', { value: true });
+    textarea.dispatchEvent(nativeEvent);
+
+    const [activator] = PointerSensor.activators;
+    const onActivation = jest.fn();
+    const activated = activator.handler(
+      { nativeEvent } as unknown as PointerEvent<HTMLElement>,
+      { onActivation },
+    );
+
+    expect(nativeEvent.target).toBe(textarea);
+    expect(activated).toBe(true);
+    expect(onActivation).toHaveBeenCalled();
+  });

Review Comment:
   The premise is inverted. Disabling drag from the title was the original 
approach here, and it was rejected in review; it made tabs undraggable whenever 
the pointer was over the tab text.
    The intended behavior is the opposite: drag stays available from the title, 
and only the cursor changes, once dragging has actually started.
   
   So this test asserts the fix, not against it; it's the regression guard that 
stops the sensor override from coming back. Note activation ≠ drag start: the 
sensor's 10px distance constraint still gates that, so a plain click on the 
title enters edit mode and accepts typing as before.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to