-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix(cdk/drag-drop): resolve helper directives with DI for proper hostDirectives support #28633
Conversation
…Directives support Currently `CdkDrag` resolve its helper directives (e.g. handle or preview) using a content query, but that doesn't work when it's applied as a host directive, because no content is being projected. These changes switch to having the helper directives inject the closest drag directive and register themselves manually. Fixes angular#28614.
2bd958f
to
f3c571d
Compare
…Directives support (#28633) Currently `CdkDrag` resolve its helper directives (e.g. handle or preview) using a content query, but that doesn't work when it's applied as a host directive, because no content is being projected. These changes switch to having the helper directives inject the closest drag directive and register themselves manually. Fixes #28614. (cherry picked from commit ef68e32)
I think the changes in this commit may have caused a dependency injection issue when combining virtual scroll and drag and drop. I've setup a very minimal StackBlitz example to show the issue here: https://stackblitz.com/edit/f2xpkk. If you load the example as it is currently with version 17.2.2, you'll see the following stack trace: If you go to package.json and set all the angular packages to 17.2.1 and refresh, the page will load with no issues. Is this expected or intentional based on the layout of the component? |
…eholder Fixes a regression from angular#28633 where using `cdkDragPlaceholder` or `cdkDragPreview` without a `cdkDrag` would throw. Technically this is a no-op, but it appears that folks started depending on the old behavior so these changes bring it back. Fixes angular#28744.
…eholder (#28750) Fixes a regression from #28633 where using `cdkDragPlaceholder` or `cdkDragPreview` without a `cdkDrag` would throw. Technically this is a no-op, but it appears that folks started depending on the old behavior so these changes bring it back. Fixes #28744. (cherry picked from commit 9343131)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently
CdkDrag
resolves its helper directives (e.g. handle or preview) using a content query, but that doesn't work when it's applied as a host directive, because no content is being projected.These changes switch to having the helper directives inject the closest drag directive and register themselves manually.
Fixes #28614.