By mistake, I was working on an older version of Angular in StackBlitz (a code-pane platform).
I came across a function called enter on GitHub, but it didn't solve my issue. I was working on a grid-based drag and drop feature that allows dragging between different containers. I forked it from Angular DragDrop Grid. The only error I encountered when upgrading to the latest version (12.1.2) is here:
this.placeholder.enter(
drag,
drag.element.nativeElement.offsetLeft,
drag.element.nativeElement.offsetTop
);
Error:
Property 'enter' does not exist on type 'CdkDropList<any>'
The only reference I found for this issue is on this Stack Overflow page. When I tried the suggested solution, the behavior was incorrect and the console displayed this error:
Uncaught RangeError: Maximum call stack size exceeded
.
Currently, this is the current state.
I aim to migrate this functionality to the latest CDK version without losing its capabilities.
Switching back and forth between versions, I noticed that the behavior of cdkDropListEnterPredicate
has changed.
In v9, cdkDropListEnterPredicate
calls the functions every pixel, but in v12, the behavior is different.
To see the error in action, navigate to the package.json
and change
"@angular/cdk": "9.1.2"
to: "@angular/cdk": "12.1.2"
I attempted to use dragRef
and dropListRef
but encountered failures.