Skip to content

fix(drag-drop): disable drag on secondary pointer button - #17520

Open
igdmdimitrov wants to merge 4 commits into
masterfrom
dmdimitrov/fix-17424
Open

fix(drag-drop): disable drag on secondary pointer button#17520
igdmdimitrov wants to merge 4 commits into
masterfrom
dmdimitrov/fix-17424

Conversation

@igdmdimitrov

Copy link
Copy Markdown
Contributor

Closes #17424

Description

Modifying drag-drop directive to start drag only on primary mouse button

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them
  • Accessibility (ARIA, keyboard navigation, focus management) has been verified

Copilot AI lite review requested due to automatic review settings August 24, 2026 13:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the IgxDragDirective to prevent drag (and the related dragClick) from being initiated via secondary mouse/pointer buttons (e.g., right-click), addressing unintended interactions like chip selection and grid row dragging on right-click.

Changes:

  • Added an early-return guard in IgxDragDirective.onPointerDown to only start interactions on the primary button (button === 0).
  • Added a unit test ensuring dragging is not initiated when pointerdown is triggered with a secondary button.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
projects/igniteui-angular/directives/src/directives/drag-drop/drag-drop.directive.ts Adds a primary-button-only guard to prevent right-click initiating drag/click behavior.
projects/igniteui-angular/directives/src/directives/drag-drop/drag-drop.spec.ts Adds coverage verifying secondary-button pointer interactions do not start dragging or emit drag events.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

igdmdimitrov and others added 2 commits August 24, 2026 16:11
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@igdmdimitrov igdmdimitrov added the 🛠️ status: in-development Issues and PRs with active development on them label Aug 24, 2026
@igdmdimitrov igdmdimitrov removed the 🛠️ status: in-development Issues and PRs with active development on them label Aug 24, 2026
@igdmdimitrov
igdmdimitrov requested a review from mddragnev August 24, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[igxDrag]: dragging can be performed on right click

2 participants