Nested Drag and Drop in with Angular 7 Material CDK










1















I've got a nested tree (Not the tree component) of drag and drop lists.



When dragging items around in drop lists that are contained inside of another drop list - Enter / Exit events are firing for both drop lists, meaning that when an item is dropped it could either be dropped into the inner drop list or the container drop list depending where it was dropped (Note: These lists are all linked to each other)



I'm thinking at the moment that the best solution will to be suppress events firing for the container list if the drag is currently over an inner list but I'm not sure if this is the best solution or exactly how to do it at the moment.










share|improve this question
























  • I think material's drag and drop still have many features need to do.may be you could search in official github issues.

    – junk
    Nov 13 '18 at 1:49











  • @junk I did manage to get this working, although i'm sure as Material's drag and drop CDK evolves so will the solution.

    – anewtonlevey
    Nov 13 '18 at 2:22















1















I've got a nested tree (Not the tree component) of drag and drop lists.



When dragging items around in drop lists that are contained inside of another drop list - Enter / Exit events are firing for both drop lists, meaning that when an item is dropped it could either be dropped into the inner drop list or the container drop list depending where it was dropped (Note: These lists are all linked to each other)



I'm thinking at the moment that the best solution will to be suppress events firing for the container list if the drag is currently over an inner list but I'm not sure if this is the best solution or exactly how to do it at the moment.










share|improve this question
























  • I think material's drag and drop still have many features need to do.may be you could search in official github issues.

    – junk
    Nov 13 '18 at 1:49











  • @junk I did manage to get this working, although i'm sure as Material's drag and drop CDK evolves so will the solution.

    – anewtonlevey
    Nov 13 '18 at 2:22













1












1








1


1






I've got a nested tree (Not the tree component) of drag and drop lists.



When dragging items around in drop lists that are contained inside of another drop list - Enter / Exit events are firing for both drop lists, meaning that when an item is dropped it could either be dropped into the inner drop list or the container drop list depending where it was dropped (Note: These lists are all linked to each other)



I'm thinking at the moment that the best solution will to be suppress events firing for the container list if the drag is currently over an inner list but I'm not sure if this is the best solution or exactly how to do it at the moment.










share|improve this question
















I've got a nested tree (Not the tree component) of drag and drop lists.



When dragging items around in drop lists that are contained inside of another drop list - Enter / Exit events are firing for both drop lists, meaning that when an item is dropped it could either be dropped into the inner drop list or the container drop list depending where it was dropped (Note: These lists are all linked to each other)



I'm thinking at the moment that the best solution will to be suppress events firing for the container list if the drag is currently over an inner list but I'm not sure if this is the best solution or exactly how to do it at the moment.







angular drag-and-drop angular7 angular-cdk






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 15 '18 at 23:41









Goncalo Peres

1,4791720




1,4791720










asked Nov 12 '18 at 23:57









anewtonleveyanewtonlevey

559




559












  • I think material's drag and drop still have many features need to do.may be you could search in official github issues.

    – junk
    Nov 13 '18 at 1:49











  • @junk I did manage to get this working, although i'm sure as Material's drag and drop CDK evolves so will the solution.

    – anewtonlevey
    Nov 13 '18 at 2:22

















  • I think material's drag and drop still have many features need to do.may be you could search in official github issues.

    – junk
    Nov 13 '18 at 1:49











  • @junk I did manage to get this working, although i'm sure as Material's drag and drop CDK evolves so will the solution.

    – anewtonlevey
    Nov 13 '18 at 2:22
















I think material's drag and drop still have many features need to do.may be you could search in official github issues.

– junk
Nov 13 '18 at 1:49





I think material's drag and drop still have many features need to do.may be you could search in official github issues.

– junk
Nov 13 '18 at 1:49













@junk I did manage to get this working, although i'm sure as Material's drag and drop CDK evolves so will the solution.

– anewtonlevey
Nov 13 '18 at 2:22





@junk I did manage to get this working, although i'm sure as Material's drag and drop CDK evolves so will the solution.

– anewtonlevey
Nov 13 '18 at 2:22












2 Answers
2






active

oldest

votes


















0














The problem with this solution is that the predicate does not affect already ongoing drag within CdkDropList where the drag originated.



This is a problem because while moving objects 'up' the hierarchy works (because of the predicate function), moving, for example, one item under it's sibling, 'down' in hierarchy causes unavoidable overlap of 2 CdkDropLists areas which will result in race condition.



This is the main problem that needs solving - how to arbitrary tell parent CdkDropList to 'stop considering' the CdkDrag (reacting to the drag) while still being able to effectively drop it in the child CdkDropList



Or in other words - get all of CdkDropLists pierced by Z axis of X,Y marked by pointer position, choose one with the smallest area (the 'youngest') and make the rest 'non responsive' to current drag.






share|improve this answer























  • Yeah it's definitely clunky. The can drop predicate gets called often enough that you can find your way into the smaller list eventually, it's a pain though. When I get the chance I might split this into a seperate repo and maybe as a community we can get to a better implementation

    – anewtonlevey
    Jan 10 at 22:57


















-1














I did manage to find a solution to this, although it's definitely hacky and involves accessing a private value with the Angular drag and drop CDK.



I use the cdkDropListEnterPredicate function to check which list it should be trying to drop into, which i assign the canDropPredicate function.



I'm also forced to get access to the pointer position via: _pointerPositionAtLastDirectionChange which isn't great as not all the values I'd like to see passed into the cdkDropListEnterPredicate get passed.



canDropPredicate(): Function 
const me = this;
return (drag: CdkDrag<ResourceNode>, drop: CdkDropList<ResourceNode>): boolean =>
const fromBounds = drag.dropContainer.element.nativeElement.getBoundingClientRect();
const toBounds = drop.element.nativeElement.getBoundingClientRect();

if (!me.intersect(fromBounds, toBounds))
return true;


// This gross but allows us to access a private field for now.
const pointerPosition: Point = drag['_dragRef']['_pointerPositionAtLastDirectionChange'];
// They Intersect with each other so we need to do some calculations here.
if (me.insideOf(fromBounds, toBounds))
return !me.pointInsideOf(pointerPosition, fromBounds);


if (me.insideOf(toBounds, fromBounds) && me.pointInsideOf(pointerPosition, toBounds))
return true;

return false;
;


intersect(r1: DOMRect | ClientRect, r2: DOMRect | ClientRect): boolean

insideOf(innerRect: DOMRect | ClientRect, outerRect: DOMRect | ClientRect): boolean
return innerRect.left >= outerRect.left &&
innerRect.right <= outerRect.right &&
innerRect.top >= outerRect.top &&
innerRect.bottom <= outerRect.bottom &&
!(
innerRect.left === outerRect.left &&
innerRect.right === outerRect.right &&
innerRect.top === outerRect.top &&
innerRect.bottom === outerRect.bottom
);


pointInsideOf(position: Point, rect: DOMRect | ClientRect)
return position.x >= rect.left &&
position.x <= rect.right &&
position.y >= rect.top &&
position.y <= rect.bottom;






share|improve this answer

























  • you extend the component?

    – junk
    Nov 13 '18 at 2:29











  • This is within my tree component (No relation to the Angular Tree component) and I set the cdkDropListEnterPredicate to canDropPredicate

    – anewtonlevey
    Nov 13 '18 at 2:36












  • @anewtonlevey is there any progress regarding nested lists? would you like to share a stackblitz?

    – Andre Elrico
    Dec 7 '18 at 14:09











  • Doesn't work? How would setting the canDropPredicate do anything for nested lists?

    – Man Personson
    Jan 9 at 17:41












  • canDropPredicate normally just returns true, so by checking the intersection I can determine that we can drop into the inner list and return false for the outer list.

    – anewtonlevey
    Jan 10 at 22:50










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53271834%2fnested-drag-and-drop-in-with-angular-7-material-cdk%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














The problem with this solution is that the predicate does not affect already ongoing drag within CdkDropList where the drag originated.



This is a problem because while moving objects 'up' the hierarchy works (because of the predicate function), moving, for example, one item under it's sibling, 'down' in hierarchy causes unavoidable overlap of 2 CdkDropLists areas which will result in race condition.



This is the main problem that needs solving - how to arbitrary tell parent CdkDropList to 'stop considering' the CdkDrag (reacting to the drag) while still being able to effectively drop it in the child CdkDropList



Or in other words - get all of CdkDropLists pierced by Z axis of X,Y marked by pointer position, choose one with the smallest area (the 'youngest') and make the rest 'non responsive' to current drag.






share|improve this answer























  • Yeah it's definitely clunky. The can drop predicate gets called often enough that you can find your way into the smaller list eventually, it's a pain though. When I get the chance I might split this into a seperate repo and maybe as a community we can get to a better implementation

    – anewtonlevey
    Jan 10 at 22:57















0














The problem with this solution is that the predicate does not affect already ongoing drag within CdkDropList where the drag originated.



This is a problem because while moving objects 'up' the hierarchy works (because of the predicate function), moving, for example, one item under it's sibling, 'down' in hierarchy causes unavoidable overlap of 2 CdkDropLists areas which will result in race condition.



This is the main problem that needs solving - how to arbitrary tell parent CdkDropList to 'stop considering' the CdkDrag (reacting to the drag) while still being able to effectively drop it in the child CdkDropList



Or in other words - get all of CdkDropLists pierced by Z axis of X,Y marked by pointer position, choose one with the smallest area (the 'youngest') and make the rest 'non responsive' to current drag.






share|improve this answer























  • Yeah it's definitely clunky. The can drop predicate gets called often enough that you can find your way into the smaller list eventually, it's a pain though. When I get the chance I might split this into a seperate repo and maybe as a community we can get to a better implementation

    – anewtonlevey
    Jan 10 at 22:57













0












0








0







The problem with this solution is that the predicate does not affect already ongoing drag within CdkDropList where the drag originated.



This is a problem because while moving objects 'up' the hierarchy works (because of the predicate function), moving, for example, one item under it's sibling, 'down' in hierarchy causes unavoidable overlap of 2 CdkDropLists areas which will result in race condition.



This is the main problem that needs solving - how to arbitrary tell parent CdkDropList to 'stop considering' the CdkDrag (reacting to the drag) while still being able to effectively drop it in the child CdkDropList



Or in other words - get all of CdkDropLists pierced by Z axis of X,Y marked by pointer position, choose one with the smallest area (the 'youngest') and make the rest 'non responsive' to current drag.






share|improve this answer













The problem with this solution is that the predicate does not affect already ongoing drag within CdkDropList where the drag originated.



This is a problem because while moving objects 'up' the hierarchy works (because of the predicate function), moving, for example, one item under it's sibling, 'down' in hierarchy causes unavoidable overlap of 2 CdkDropLists areas which will result in race condition.



This is the main problem that needs solving - how to arbitrary tell parent CdkDropList to 'stop considering' the CdkDrag (reacting to the drag) while still being able to effectively drop it in the child CdkDropList



Or in other words - get all of CdkDropLists pierced by Z axis of X,Y marked by pointer position, choose one with the smallest area (the 'youngest') and make the rest 'non responsive' to current drag.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 10 at 22:16









BrachaczBrachacz

512




512












  • Yeah it's definitely clunky. The can drop predicate gets called often enough that you can find your way into the smaller list eventually, it's a pain though. When I get the chance I might split this into a seperate repo and maybe as a community we can get to a better implementation

    – anewtonlevey
    Jan 10 at 22:57

















  • Yeah it's definitely clunky. The can drop predicate gets called often enough that you can find your way into the smaller list eventually, it's a pain though. When I get the chance I might split this into a seperate repo and maybe as a community we can get to a better implementation

    – anewtonlevey
    Jan 10 at 22:57
















Yeah it's definitely clunky. The can drop predicate gets called often enough that you can find your way into the smaller list eventually, it's a pain though. When I get the chance I might split this into a seperate repo and maybe as a community we can get to a better implementation

– anewtonlevey
Jan 10 at 22:57





Yeah it's definitely clunky. The can drop predicate gets called often enough that you can find your way into the smaller list eventually, it's a pain though. When I get the chance I might split this into a seperate repo and maybe as a community we can get to a better implementation

– anewtonlevey
Jan 10 at 22:57













-1














I did manage to find a solution to this, although it's definitely hacky and involves accessing a private value with the Angular drag and drop CDK.



I use the cdkDropListEnterPredicate function to check which list it should be trying to drop into, which i assign the canDropPredicate function.



I'm also forced to get access to the pointer position via: _pointerPositionAtLastDirectionChange which isn't great as not all the values I'd like to see passed into the cdkDropListEnterPredicate get passed.



canDropPredicate(): Function 
const me = this;
return (drag: CdkDrag<ResourceNode>, drop: CdkDropList<ResourceNode>): boolean =>
const fromBounds = drag.dropContainer.element.nativeElement.getBoundingClientRect();
const toBounds = drop.element.nativeElement.getBoundingClientRect();

if (!me.intersect(fromBounds, toBounds))
return true;


// This gross but allows us to access a private field for now.
const pointerPosition: Point = drag['_dragRef']['_pointerPositionAtLastDirectionChange'];
// They Intersect with each other so we need to do some calculations here.
if (me.insideOf(fromBounds, toBounds))
return !me.pointInsideOf(pointerPosition, fromBounds);


if (me.insideOf(toBounds, fromBounds) && me.pointInsideOf(pointerPosition, toBounds))
return true;

return false;
;


intersect(r1: DOMRect | ClientRect, r2: DOMRect | ClientRect): boolean

insideOf(innerRect: DOMRect | ClientRect, outerRect: DOMRect | ClientRect): boolean
return innerRect.left >= outerRect.left &&
innerRect.right <= outerRect.right &&
innerRect.top >= outerRect.top &&
innerRect.bottom <= outerRect.bottom &&
!(
innerRect.left === outerRect.left &&
innerRect.right === outerRect.right &&
innerRect.top === outerRect.top &&
innerRect.bottom === outerRect.bottom
);


pointInsideOf(position: Point, rect: DOMRect | ClientRect)
return position.x >= rect.left &&
position.x <= rect.right &&
position.y >= rect.top &&
position.y <= rect.bottom;






share|improve this answer

























  • you extend the component?

    – junk
    Nov 13 '18 at 2:29











  • This is within my tree component (No relation to the Angular Tree component) and I set the cdkDropListEnterPredicate to canDropPredicate

    – anewtonlevey
    Nov 13 '18 at 2:36












  • @anewtonlevey is there any progress regarding nested lists? would you like to share a stackblitz?

    – Andre Elrico
    Dec 7 '18 at 14:09











  • Doesn't work? How would setting the canDropPredicate do anything for nested lists?

    – Man Personson
    Jan 9 at 17:41












  • canDropPredicate normally just returns true, so by checking the intersection I can determine that we can drop into the inner list and return false for the outer list.

    – anewtonlevey
    Jan 10 at 22:50















-1














I did manage to find a solution to this, although it's definitely hacky and involves accessing a private value with the Angular drag and drop CDK.



I use the cdkDropListEnterPredicate function to check which list it should be trying to drop into, which i assign the canDropPredicate function.



I'm also forced to get access to the pointer position via: _pointerPositionAtLastDirectionChange which isn't great as not all the values I'd like to see passed into the cdkDropListEnterPredicate get passed.



canDropPredicate(): Function 
const me = this;
return (drag: CdkDrag<ResourceNode>, drop: CdkDropList<ResourceNode>): boolean =>
const fromBounds = drag.dropContainer.element.nativeElement.getBoundingClientRect();
const toBounds = drop.element.nativeElement.getBoundingClientRect();

if (!me.intersect(fromBounds, toBounds))
return true;


// This gross but allows us to access a private field for now.
const pointerPosition: Point = drag['_dragRef']['_pointerPositionAtLastDirectionChange'];
// They Intersect with each other so we need to do some calculations here.
if (me.insideOf(fromBounds, toBounds))
return !me.pointInsideOf(pointerPosition, fromBounds);


if (me.insideOf(toBounds, fromBounds) && me.pointInsideOf(pointerPosition, toBounds))
return true;

return false;
;


intersect(r1: DOMRect | ClientRect, r2: DOMRect | ClientRect): boolean

insideOf(innerRect: DOMRect | ClientRect, outerRect: DOMRect | ClientRect): boolean
return innerRect.left >= outerRect.left &&
innerRect.right <= outerRect.right &&
innerRect.top >= outerRect.top &&
innerRect.bottom <= outerRect.bottom &&
!(
innerRect.left === outerRect.left &&
innerRect.right === outerRect.right &&
innerRect.top === outerRect.top &&
innerRect.bottom === outerRect.bottom
);


pointInsideOf(position: Point, rect: DOMRect | ClientRect)
return position.x >= rect.left &&
position.x <= rect.right &&
position.y >= rect.top &&
position.y <= rect.bottom;






share|improve this answer

























  • you extend the component?

    – junk
    Nov 13 '18 at 2:29











  • This is within my tree component (No relation to the Angular Tree component) and I set the cdkDropListEnterPredicate to canDropPredicate

    – anewtonlevey
    Nov 13 '18 at 2:36












  • @anewtonlevey is there any progress regarding nested lists? would you like to share a stackblitz?

    – Andre Elrico
    Dec 7 '18 at 14:09











  • Doesn't work? How would setting the canDropPredicate do anything for nested lists?

    – Man Personson
    Jan 9 at 17:41












  • canDropPredicate normally just returns true, so by checking the intersection I can determine that we can drop into the inner list and return false for the outer list.

    – anewtonlevey
    Jan 10 at 22:50













-1












-1








-1







I did manage to find a solution to this, although it's definitely hacky and involves accessing a private value with the Angular drag and drop CDK.



I use the cdkDropListEnterPredicate function to check which list it should be trying to drop into, which i assign the canDropPredicate function.



I'm also forced to get access to the pointer position via: _pointerPositionAtLastDirectionChange which isn't great as not all the values I'd like to see passed into the cdkDropListEnterPredicate get passed.



canDropPredicate(): Function 
const me = this;
return (drag: CdkDrag<ResourceNode>, drop: CdkDropList<ResourceNode>): boolean =>
const fromBounds = drag.dropContainer.element.nativeElement.getBoundingClientRect();
const toBounds = drop.element.nativeElement.getBoundingClientRect();

if (!me.intersect(fromBounds, toBounds))
return true;


// This gross but allows us to access a private field for now.
const pointerPosition: Point = drag['_dragRef']['_pointerPositionAtLastDirectionChange'];
// They Intersect with each other so we need to do some calculations here.
if (me.insideOf(fromBounds, toBounds))
return !me.pointInsideOf(pointerPosition, fromBounds);


if (me.insideOf(toBounds, fromBounds) && me.pointInsideOf(pointerPosition, toBounds))
return true;

return false;
;


intersect(r1: DOMRect | ClientRect, r2: DOMRect | ClientRect): boolean

insideOf(innerRect: DOMRect | ClientRect, outerRect: DOMRect | ClientRect): boolean
return innerRect.left >= outerRect.left &&
innerRect.right <= outerRect.right &&
innerRect.top >= outerRect.top &&
innerRect.bottom <= outerRect.bottom &&
!(
innerRect.left === outerRect.left &&
innerRect.right === outerRect.right &&
innerRect.top === outerRect.top &&
innerRect.bottom === outerRect.bottom
);


pointInsideOf(position: Point, rect: DOMRect | ClientRect)
return position.x >= rect.left &&
position.x <= rect.right &&
position.y >= rect.top &&
position.y <= rect.bottom;






share|improve this answer















I did manage to find a solution to this, although it's definitely hacky and involves accessing a private value with the Angular drag and drop CDK.



I use the cdkDropListEnterPredicate function to check which list it should be trying to drop into, which i assign the canDropPredicate function.



I'm also forced to get access to the pointer position via: _pointerPositionAtLastDirectionChange which isn't great as not all the values I'd like to see passed into the cdkDropListEnterPredicate get passed.



canDropPredicate(): Function 
const me = this;
return (drag: CdkDrag<ResourceNode>, drop: CdkDropList<ResourceNode>): boolean =>
const fromBounds = drag.dropContainer.element.nativeElement.getBoundingClientRect();
const toBounds = drop.element.nativeElement.getBoundingClientRect();

if (!me.intersect(fromBounds, toBounds))
return true;


// This gross but allows us to access a private field for now.
const pointerPosition: Point = drag['_dragRef']['_pointerPositionAtLastDirectionChange'];
// They Intersect with each other so we need to do some calculations here.
if (me.insideOf(fromBounds, toBounds))
return !me.pointInsideOf(pointerPosition, fromBounds);


if (me.insideOf(toBounds, fromBounds) && me.pointInsideOf(pointerPosition, toBounds))
return true;

return false;
;


intersect(r1: DOMRect | ClientRect, r2: DOMRect | ClientRect): boolean

insideOf(innerRect: DOMRect | ClientRect, outerRect: DOMRect | ClientRect): boolean
return innerRect.left >= outerRect.left &&
innerRect.right <= outerRect.right &&
innerRect.top >= outerRect.top &&
innerRect.bottom <= outerRect.bottom &&
!(
innerRect.left === outerRect.left &&
innerRect.right === outerRect.right &&
innerRect.top === outerRect.top &&
innerRect.bottom === outerRect.bottom
);


pointInsideOf(position: Point, rect: DOMRect | ClientRect)
return position.x >= rect.left &&
position.x <= rect.right &&
position.y >= rect.top &&
position.y <= rect.bottom;







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 3 at 10:59









Timo

185




185










answered Nov 13 '18 at 2:20









anewtonleveyanewtonlevey

559




559












  • you extend the component?

    – junk
    Nov 13 '18 at 2:29











  • This is within my tree component (No relation to the Angular Tree component) and I set the cdkDropListEnterPredicate to canDropPredicate

    – anewtonlevey
    Nov 13 '18 at 2:36












  • @anewtonlevey is there any progress regarding nested lists? would you like to share a stackblitz?

    – Andre Elrico
    Dec 7 '18 at 14:09











  • Doesn't work? How would setting the canDropPredicate do anything for nested lists?

    – Man Personson
    Jan 9 at 17:41












  • canDropPredicate normally just returns true, so by checking the intersection I can determine that we can drop into the inner list and return false for the outer list.

    – anewtonlevey
    Jan 10 at 22:50

















  • you extend the component?

    – junk
    Nov 13 '18 at 2:29











  • This is within my tree component (No relation to the Angular Tree component) and I set the cdkDropListEnterPredicate to canDropPredicate

    – anewtonlevey
    Nov 13 '18 at 2:36












  • @anewtonlevey is there any progress regarding nested lists? would you like to share a stackblitz?

    – Andre Elrico
    Dec 7 '18 at 14:09











  • Doesn't work? How would setting the canDropPredicate do anything for nested lists?

    – Man Personson
    Jan 9 at 17:41












  • canDropPredicate normally just returns true, so by checking the intersection I can determine that we can drop into the inner list and return false for the outer list.

    – anewtonlevey
    Jan 10 at 22:50
















you extend the component?

– junk
Nov 13 '18 at 2:29





you extend the component?

– junk
Nov 13 '18 at 2:29













This is within my tree component (No relation to the Angular Tree component) and I set the cdkDropListEnterPredicate to canDropPredicate

– anewtonlevey
Nov 13 '18 at 2:36






This is within my tree component (No relation to the Angular Tree component) and I set the cdkDropListEnterPredicate to canDropPredicate

– anewtonlevey
Nov 13 '18 at 2:36














@anewtonlevey is there any progress regarding nested lists? would you like to share a stackblitz?

– Andre Elrico
Dec 7 '18 at 14:09





@anewtonlevey is there any progress regarding nested lists? would you like to share a stackblitz?

– Andre Elrico
Dec 7 '18 at 14:09













Doesn't work? How would setting the canDropPredicate do anything for nested lists?

– Man Personson
Jan 9 at 17:41






Doesn't work? How would setting the canDropPredicate do anything for nested lists?

– Man Personson
Jan 9 at 17:41














canDropPredicate normally just returns true, so by checking the intersection I can determine that we can drop into the inner list and return false for the outer list.

– anewtonlevey
Jan 10 at 22:50





canDropPredicate normally just returns true, so by checking the intersection I can determine that we can drop into the inner list and return false for the outer list.

– anewtonlevey
Jan 10 at 22:50

















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53271834%2fnested-drag-and-drop-in-with-angular-7-material-cdk%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

政党

天津地下鉄3号線