Comments (6)
I'm very sorry for this imprecise bug report.
In the meantime I setup a brand new Angular "Hello World" project and realized that ng-sortgrid
works with Angular version 13.2.4.
So I went deeper in root cause analyses and found out what causes the issue I encountered in my project.
Generally, I use Angular's CDK Drag'n'Drop functionality to make blocks in vertical order sortable. Inside one of these blocks I have a grid that I made sortable with ng-sortgrid
because Angular Drag'n'Drop functionality with display: flex; flex-wrap: wrap
is still a big pain in the ass.
So far this worked like a charm, but with upgrading Angular from version 13.2.3 to 13.2.4 ng-sortgrid
functionality broke completely, because mouse events were not recognized anymore with ng-sortgrid
.
When I remove Angular's CDK Drag'n'Drop functionality in the parent's DIV, ng-sortgrid
works again.
I don't have a solution yet, but it has absolutely nothing to do with ng-sortgrid
, so I close this issue.
from ng-sortgrid.
@loebi-ch. Wow. Thx a lot for the research and the awesome explanation. Glad to hear that it works. I already started researching a bit but couldn't figure out a solution. But thx to your explanation everything makes perfect sense now. Thx a lot 👍
from ng-sortgrid.
I've found the root cause in Angular's cdk/drag-drop/drag-ref.ts
In Angular CDK version 13.2.4 they've added a line to preventDefault() on dragstart event.
If I comment out the above line again, ng-sortgrid
works again.
from ng-sortgrid.
I opened a new bug report within angular/components:
angular/components#24533
from ng-sortgrid.
👍
from ng-sortgrid.
I have found a solution:
Use (dragstart)="$event.stopPropagation()"
within cdkDrag
element:
<div cdkDropList>
<div class="block" cdkDrag>
<span cdkDragHandle>:</span> Block 1
</div>
<div class="block" cdkDrag>
<span cdkDragHandle>:</span> Block 2
<ul (dragstart)="$event.stopPropagation()">
<li *ngFor="let item of items" ngSortgridItem [ngSortGridItems]="items">List Item {{item}}</li>
</ul>
</div>
</div>
from ng-sortgrid.
Related Issues (20)
- Is it possible to have multiple grid ? HOT 1
- Update to Angular 12 HOT 4
- Version 5 peer dependencies for Angular 10 instead of 12 HOT 1
- duplicate selected col while draging HOT 1
- Update to Angular 13 HOT 4
- 6.0.0 still depends on Angular 12 HOT 2
- Demo URL mentioned in the read.me page is not working: 404 HOT 2
- Scrolling not working on multiple item drag and drop for sorting on Windows
- Card item select and drag on scrolling mouse wheel in Windows OS browsers
- The automated release is failing 🚨
- directive not working when nested in a cdkDropList HOT 2
- Angular 15 compatibility HOT 3
- Angular 15 peerDependencies HOT 1
- Can't bind to 'ngSortGridItems' since it isn't a known property of 'div'. HOT 2
- Can't apply the directive
- Angular 16 support HOT 4
- Problem with nested lists HOT 1
- Angular 17 HOT 2
- Angular 18 support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng-sortgrid.