Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(DragDrop): DragDrop started to be draggable outside of it's zone #19919

Closed
laserus opened this issue Jul 9, 2020 · 10 comments
Closed

bug(DragDrop): DragDrop started to be draggable outside of it's zone #19919

laserus opened this issue Jul 9, 2020 · 10 comments
Assignees
Labels
area: cdk/drag-drop needs: clarification The issue does not contain enough information for the team to determine if it is a real bug

Comments

@laserus
Copy link

laserus commented Jul 9, 2020

Reproduction

New feature/bug appeared in version 9.

Use StackBlitz to reproduce your issue: https://stackblitz.com/edit/angular-nd8jwz-ochxmy?file=src%2Fapp%2Fmodal-basic.module.ts

Steps to reproduce:

  1. Open Modal
  2. Try to select text "Date of birth" with mouse
  3. For some reason the whole modal is moving

Expected Behavior

Previously, with version 8.1.4 only modal-header was place which allowed to drag modal and nothing prevented from modal-body selecting and interacting with mouse.

Actual Behavior

What behavior did you actually see?
I cannot select any text, or any input, as the whole modal is moving, although cdkDrag attached only to header and modal-dialog used only for pointer to modal which is movable by header dragging.

Environment

  • Angular:
    "@angular/animations": "~9.1.11",
    "@angular/cdk": "~9.2.4",
    "@angular/common": "~9.1.11",
    "@angular/compiler": "~9.1.11",
    "@angular/core": "~9.1.11",
    "@angular/forms": "~9.1.11",
    "@angular/localize": "^9.1.11",
    "@angular/platform-browser": "~9.1.11",
    "@angular/platform-browser-dynamic": "~9.1.11",
    "@angular/router": "~9.1.11",
    "core-js": "^2.6.7",
    "ts-helpers": "^1.1.2",
    "tslib": "^1.10.0",
    "web-animations-js": "^2.3.2",
    "zone.js": "~0.10.2"
  • CDK/Material: 9.2.4
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): image: node:12.6.0
@laserus laserus added the needs triage This issue needs to be triaged by the team label Jul 9, 2020
@crisbeto
Copy link
Member

crisbeto commented Jul 9, 2020

I think it may be resolved by #19559 which was merged in yesterday.

@jelbourn jelbourn added needs: clarification The issue does not contain enough information for the team to determine if it is a real bug and removed needs triage This issue needs to be triaged by the team labels Jul 9, 2020
@jelbourn
Copy link
Member

jelbourn commented Jul 9, 2020

@laserus let us know if this is fixed in the next patch release

@laserus
Copy link
Author

laserus commented Jul 15, 2020

@jelbourn will you release also new version of 9 with this patch? or it will be only 10?

@jelbourn
Copy link
Member

We don't plan on publishing any further 9.x releases unless there's some major bug (security, browser compatibility, etc.)

@laserus
Copy link
Author

laserus commented Jul 21, 2020

@crisbeto Is recent release includes the fix?

I quickly tried it, and have got an error:
https://stackblitz.com/edit/angular-ukjcnf?file=src%2Fapp%2Fmodal-basic.html

@laserus
Copy link
Author

laserus commented Jul 27, 2020

@jelbourn I think in 10. There is worse bug was introduced, please check the previous message and example. I also tried your stackblitz example, https://stackblitz.com/edit/components-issue-l3lbs5

Normally, I do not upgrade project to the latest majors, because of unexplored bugs. It would be cool to add such fix to 9.x.

@wagnermaciel wagnermaciel added needs triage This issue needs to be triaged by the team and removed needs: clarification The issue does not contain enough information for the team to determine if it is a real bug labels Aug 13, 2020
@crisbeto
Copy link
Member

crisbeto commented Aug 16, 2020

@laserus the error is because you've set cdkDragHandle on an ng-template which won't work since the template corresponds to an HTML comment node. We have an error for this on cdkDrag, but we forgot to add it to cdkDragHandle which is throwing before it can reach the cdkDrag assertion.

Does it work if you move the cdkDrag and cdkDragHandle to something that isn't an ng-template? e.g.

<ng-template #content>
  <div cdkDrag cdkDragHandle></div>
</ng-template>

@crisbeto crisbeto added needs: clarification The issue does not contain enough information for the team to determine if it is a real bug and removed needs triage This issue needs to be triaged by the team labels Aug 16, 2020
crisbeto added a commit to crisbeto/material2 that referenced this issue Aug 16, 2020
This came up from angular#19919, although it's not the root cause. We were disabling the native drag interactions on the handle element in two places which is redundant. These changes remove one of them and add a unit test since we were missing coverage.
wagnermaciel pushed a commit that referenced this issue Aug 20, 2020
…20330)

This came up from #19919, although it's not the root cause. We were disabling the native drag interactions on the handle element in two places which is redundant. These changes remove one of them and add a unit test since we were missing coverage.
wagnermaciel pushed a commit that referenced this issue Aug 20, 2020
…20330)

This came up from #19919, although it's not the root cause. We were disabling the native drag interactions on the handle element in two places which is redundant. These changes remove one of them and add a unit test since we were missing coverage.

(cherry picked from commit fc67ff3)
@Achilles1515
Copy link

@crisbeto @laserus
I believe this one can be closed.
StackBlitz from OP with updated dependencies no longer showing the issue.

@laserus
Copy link
Author

laserus commented Sep 30, 2020

Yes, it seems that it is solved now. Thanks

@laserus laserus closed this as completed Sep 30, 2020
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: cdk/drag-drop needs: clarification The issue does not contain enough information for the team to determine if it is a real bug
Projects
None yet
Development

No branches or pull requests

6 participants