Tips for utilizing scrollbar alongside DragAndDrop functionality in Angular 8

I created an app with drag and drop functionality that works well. However, when users add more than 10 items, the page becomes cluttered with too much dragging and dropping, making it difficult to see other items.

This app is designed to dynamically arrange modules in a specific order. It utilizes Angular 8 (recently updated from Angular 6). I attempted to implement virtual scrolling to address the issue, but encountered errors when combining it with the drag and drop feature.

<div cdkDropList #todoList="cdkDropList" [cdkDropListData]="names" class="example-list"
(cdkDropListDropped)="drop($event)">
<cdk-virtual-scroll-viewport>
    <div class="example-box" *cdkVirtualFor="let item of names; index as i" class="example-item" cdkDrag >{{item || 'Loading...'}}</div>
  </cdk-virtual-scroll-viewport>
  <button class="mat-icon-inline-2" mat-raised-button color="warn" (click)="deleteitem( (button_value = i) )">
    <mat-icon> delete </mat-icon>
  </button>
</div>
</div>

Answer №1

Maybe give this a shot, even though it's for Angular 7 I think it could work for Angular 8 as well.

Check out this link for more information!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the equivalent of specifying globalDevDependencies for npm @types packages in typings?

I am looking to update a project using tsc@2 and remove typings from my toolchain. Updating common dependencies is easy as they are listed in my typings.json file: "dependencies": { "bluebird": "registry:npm/bluebird#3.3.4+20160515010139", "lodash": ...

Enabling cookie communication between NestJS server and Next.js frontend

I seem to be encountering challenges when trying to set cookies from a NestJS backend into my Next.js app. My NestJS application is running on port 3001 and here is my bootstrap setup: async function bootstrap() { const app = await NestFactory.create(Ap ...

Typescript Support in Goland IDE for HTML Documents

I'm currently utilizing Go for my programming tasks, and I prefer the Goland IDE developed by Jetbrains. Is there a way for me to incorporate typescript into my .html template files that contain a mix of HTML, CSS, and JS? Your assistance is much ap ...

Combining Angular 2 and Sails.js for Ultimate Web Development

Looking to integrate Sails with Angular 2 and add TypeScript to my project. As a newcomer in this field, I'm unsure how to configure this. I have created a Sails app using the command: sails new myApp Could anyone guide me on how to incorporate thi ...

Execute a chain of consecutive HTTP requests and receive an Observable in response

I am currently working on two observable request functions that need to run sequentially in order for the desired outcome. Although it is functioning, I am facing an issue where the print function needs to be executed after the newOrder api call and return ...

Enabling and Disabling Angular 2 Reactive Form Fields

I'm working on creating a basic angular 2 reactive form with fields for email and phone number. Here's my code, but I'm encountering two challenges. Firstly, the verify button should be disabled initially and only enabled when an email i ...

Tips for eliminating or concealing repetitive cell text within columns

I am working with a syncfusion grid that contains repetitive data at the column level. However, I want to display only the first occurrence of the data and show a tree-like view. Please see the image below for reference: Reference Image Any suggestions on ...

A handy tool for easily previewing JavaScript code based on my TypeScript within Visual Studio

Recently I decided to dive into TypeScript. I am eager to find extensions for VisualStudio or Re# that can display live JavaScript based on the TypeScript code I write. Any suggestions for tools like this? Currently, I am using VS 2015 with Re#. ...

Angular 10 does not reflect changes in the array when they occur

My component receives an array of offers from an Observable. However, when the list is modified (a offer is deleted), the component's list does not update accordingly. I attempted to use ngOnChanges to resubscribe to the list and update it in my comp ...

Having trouble initializing JwtHelper in an Angular2 project?

Encountering an unusual exception while attempting to create a new JwtHelper in Angular2. This error has been puzzling me for quite some time because of its cryptic nature. The problem arises when I try to include JwtHelper, causing an unexpected number er ...

When working with JS Store, you may encounter an error message stating "The 'exportJson' property is not found in the 'Connection' type."

connection.exportJson({ from: "Table_Name", where: { Column1: some_value, Column2: some_another_value } }).then(function() { console.log('Export successful'); }).catch(function(error) { console.log(er ...

Implementing a rollback feature in a React + Typescript application to revert back to the previous state

When working with a list of checkboxes and using the "Apply" button to show/hide columns in a table, setting the state back to its previous value may become challenging. While achieving this functionality is possible, reverting to the previous state upon c ...

Can client-side code be altered in an Angular application?

My knowledge in JavaScript programming and Angular app development is limited, but from what I understand, JavaScript can be manipulated when it reaches the client. I recently saw a role-based authorization implementation in an Angular app where user role ...

Developing an Angular filter using pipes and mapping techniques

I am relatively new to working with Angular and I have encountered a challenge in creating a filter for a specific value. Within my component, I have the following: myData$: Observable<MyInterface> The interface structure is outlined below: export ...

Finding the attribute value within a nested array of objects retrieved from an API response

Imagine a scenario where I possess an array of unclassified objects, each of which contains an array of labeled objects: [{id: 123, name: 'Foo', code: 'ABC123', enabled: true},{id: 124, name: 'Bar', code: '123ABC', e ...

Having trouble getting TinyMCE to work properly with Angular 8 integration

I'm currently working on integrating tinymce into my Angular 8 application and encountering the following error in the VS Code console: ERROR in node_modules/@tinymce/tinymce-angular/editor/editor.component.d.ts(8,9): error TS1086: An accessor cannot ...

Displaying JSON keys and values individually on an HTML page

Looking to display a JSON array in HTML using ngFor TypeScript : import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-ng-for', templateUrl: './ng-for.component.html', styleUrls: ['./ng-for ...

There was a TypeError encountered because 'undefined' is not able to be evaluated as an object when trying to execute '_ExponentFacebook.default.initializeAsync'

I am encountering a TypeError while attempting to implement Facebook Auth in my firebase react native project, specifically at the InitalizeAsync method. import * as Facebook from 'expo-facebook'; export const loginWithFacebook = async () => ...

Functionality not working due to a separate function not being called properly in Angular 7

I am struggling to trigger a separate function when invoking a function within a service. Below is a straightforward example foo() { this.bar(); console.log('foo'); } bar() { console.log('bar'); } Upon running my code, &a ...

Cricket score update features on the client side

Looking for assistance with client-side code development! I am currently working on an Android application using Ionic that involves live cricket scores. I have purchased a cricket API and understand how to connect to it using Node.js on the server side. ...