cdkDragDrop: Logs error to the console in production
See original GitHub issueWhat are you trying to do?
I setup the drag drop functionality for angular cdk and everything works fine functionality wise. But it throws this error Unable to preventDefault inside passive event listener invocation.
on drag-ref.ts:655. This only happens when actually moving the item, if you are just holding the drag nothing is thrown. This error only appears in production. Any help would be appreciated on this.
What troubleshooting steps have you tried?
- Tried disabling pointer events when dragging
- Tried updating to most recent minor version
Reproduction
<div class="scrollable-container" #productsList="cdkDropList" cdkDropList (cdkDropListDropped)="drop($event)">
<div *ngFor="let product of availableProducts | search : 'name' : productSearch">
<div
cdkDrag
(cdkDragStarted)="dragStart(product)"
class="product-item"
>
<div class="product-list-detail">
<h5 class="p-mb-2">{{product.name}}</h5>
<span class="product-category">{{product.active ? 'Active' : 'Inactive'}}</span>
</div>
<div class="product-list-action">
<h6>{{product.price}}</h6>
</div>
</div>
</div>
</div>```
### Environment
- Angular: 11.0.9
- CDK/Material: 11.2.12 (and 11.0.9).
- Browser(s): Brave, Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Ubuntu, Windows
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:15 (4 by maintainers)
Top Results From Across the Web
angular - Type 'Event' is missing the following properties from ...
Simply importing the DragDropModule from '@angular/cdk/drag-drop' into ... example of a distracting error message produced by the compiler ...
Read more >Angular - How to remove console.logs in production build
Angular tutorial. This is example how remove console. logs in production build0:00 Use case0:40 Solution1:34 Trying to learn pianoAngular ...
Read more >Hiding console logs / warings and errors in production build in ...
For debugging our angular application the greater part of us compose console. log to see the values of a given item or variable, ......
Read more >Cdk Drag Drop Index Bug (forked) - StackBlitz
import {CdkDragDrop, moveItemInArray,. transferArrayItem} from '@angular/cdk/ ... drop(event: CdkDragDrop<any>) {. console.log('PREV', `index: ${event.
Read more >Function implementation is missing or not immediately ...
If you need to do console.log(this.users); in order to see the data in the ... OK } // comment line below and the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In my case it has something to do with session recorders. I use LogRocket for that purpose, and the error won’t pop up when session recording is disabled.
I haven’t had time to look into this yet, but I wanted to note that this is a
console.error
, not a hard error so users won’t be affected by it.