fix(dashboard-tabs): disable drag on input fields during tab reorder#36889
fix(dashboard-tabs): disable drag on input fields during tab reorder#36889
Conversation
Prevents drag activation when clicking on input/textarea elements, allowing users to edit tab titles without accidentally triggering drag-and-drop reordering
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Code Review Agent Run #f841b1Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Sequence DiagramShows how pointer events are routed to the PointerSensor which now detects interactive elements (input/textarea/contentEditable). If interactive, drag activation is prevented so the user can edit the tab title; otherwise the normal drag-reorder flow proceeds. sequenceDiagram
participant User
participant Browser
participant PointerSensor
participant DndContext
participant TabsRenderer
User->>Browser: Pointer down on tab title
Browser->>PointerSensor: Deliver pointer event
alt Target is interactive (input/textarea/contentEditable)
PointerSensor-->>Browser: Prevent drag activation
Browser-->>User: Show text cursor / allow editing
User->>TabsRenderer: Edit tab title
TabsRenderer-->>User: Save/display updated title
else Target is non-interactive
PointerSensor->>DndContext: Activate drag
DndContext->>TabsRenderer: Reorder tabs onDragEnd
TabsRenderer-->>User: Render reordered tabs
end
Generated by CodeAnt AI |
Nitpicks 🔍
|
superset-frontend/src/dashboard/components/gridComponents/TabsRenderer/TabsRenderer.tsx
Show resolved
Hide resolved
|
CodeAnt AI finished reviewing your PR. |
|
🎪 Showtime deployed environment on GHA for ad53a4c • Environment: http://54.218.223.66:8080 (admin/admin) |
|
🎪 Showtime deployed environment on GHA for b5e76cc • Environment: http://35.95.20.49:8080 (admin/admin) |
|
CodeAnt AI is running Incremental review Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
CodeAnt AI is running Incremental review Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Sequence DiagramShows how the PR customizes the PointerSensor activators to prevent drag activation when the user interacts with editable tab title fields, preserving normal text editing instead of starting a tab reorder. sequenceDiagram
participant User
participant Browser
participant PointerSensor
participant DndContext
participant TabsRenderer
User->>Browser: pointerdown on tab title (target)
Browser->>PointerSensor: onPointerDown event (nativeEvent)
PointerSensor->>PointerSensor: isInteractiveElement(target)?
alt target is input/textarea/contentEditable
PointerSensor-->>Browser: return false (no activation)
Browser-->>User: show text cursor / allow editing
else non-interactive target
PointerSensor->>DndContext: onActivation -> start drag
DndContext-->>TabsRenderer: onDragStart -> setActiveId
DndContext->>DndContext: drag and drop occurs
DndContext-->>TabsRenderer: onDragEnd -> call onTabsReorder (if moved)
Generated by CodeAnt AI |
|
CodeAnt AI Incremental review completed. |
Sequence DiagramThe PR customizes PointerSensor activation to detect interactive elements (input/textarea/contentEditable) and prevent drag activation when the user clicks them, so editing tab titles shows the text cursor instead of starting a drag. sequenceDiagram
participant User
participant TabsUI as Tabs Renderer
participant PointerSensor
participant DnD as DndContext
participant Browser
User->>TabsUI: Pointer down on tab title
TabsUI->>PointerSensor: Check activation target
PointerSensor->>PointerSensor: Is target input/textarea/contentEditable?
alt Target is interactive
PointerSensor-->>TabsUI: Prevent drag activation
TabsUI-->>Browser: Let browser show text cursor / allow editing
Browser-->>User: Text cursor, edit title
else Target not interactive
PointerSensor-->>Dnd: Activate drag
Dnd-->>TabsUI: Reorder tabs (update state)
TabsUI-->>User: Tab reordered
end
Generated by CodeAnt AI |
Sequence DiagramThe PR customizes PointerSensor activation so pointer-down on input/textarea/contentEditable elements does not start a drag; this preserves the text cursor and allows editing, while non-interactive areas still activate drag-and-drop reordering. sequenceDiagram
participant User
participant PointerSensor
participant Browser
participant DndContext
participant TabsRenderer
User->>PointerSensor: pointerDown on tab title
PointerSensor->>PointerSensor: check target is input/textarea/contentEditable?
alt target is interactive
PointerSensor-->>Browser: do not activate drag (return false)
Browser-->>User: show text cursor, allow editing
else target is non-interactive
PointerSensor->>DndContext: onActivation -> start drag
DndContext->>TabsRenderer: onDragStart (set active tab)
User->>DndContext: drag & drop
DndContext->>TabsRenderer: onDragEnd -> onTabsReorder(oldIndex, newIndex)
Generated by CodeAnt AI |
User description
SUMMARY
This PR fixes a cosmetic issue in the dashboard tab reordering feature where the cursor would incorrectly show as a drag cursor when hovering over the tab title input field.
The Problem
When hovering over the input field used to edit tab names, the drag cursor would appear instead of the text cursor, even though editing was still possible. This created a confusing user experience where the visual feedback didn't match the expected behavior.
The Solution
We customize the
PointerSensor.activatorsto check if the pointer target is an interactive element (input, textarea, or contentEditable).When an interactive element is detected, drag activation is prevented, allowing the browser to show the correct text cursor and making the interaction feel more natural.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
before-custom-tag.mp4
after-custom-tag.mp4
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION
es new feature or API
CodeAnt-AI Description
Disable drag while editing tab titles to prevent accidental reorders
What Changed
Impact
✅ Fewer accidental tab reorders✅ Clearer tab title editing✅ Correct text cursor when editing tabs💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.