How can the button press, release, drag, and drop events be implemented in Ionic?

I have been working on adding a recording feature that allows for recording when a button is pressed and stops when it is released. I decided to use the ionic-long-press plugin for this functionality. However, I have noticed that it does not support drag and drop events. Any suggestions or advice on how to handle this issue would be greatly appreciated. Thank you.

Answer №2

Regrettably, mobile devices do not support drag/drop events, but they do support touch events.

Therefore, you can either utilize touch (touchstart/touchend/touchmove) events or incorporate the following drag-drop-touch polyfill in your project if you wish to use HTML 5 drag/drop events on mobile devices.

This polyfill effectively translates touch events into drag/drop events. I personally implemented it in my project and it functions flawlessly.

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

Utilizing Logical Operators in Typescript Typing

What is the preferred method for boolean comparisons in Typescript types? I have devised the following types for this purpose, but I am curious if there is a more standard or efficient approach: type And<T1 extends boolean, T2 extends boolean> = T1 ...

Utilize ngrx/store to capture events from various components within an Angular application

Is there a way to utilize ngrx store in Angular to capture events from a grandchild component without relying on a service, Behavior Subject, or @Output? ...

What is the best way to iterate through my data object using *ngFor?

Here is my "monthlyCalendar" object: { "monthName": "September 2019", "dateObjList": { "1": { "dayOfWeek": "0", "isPublicHoliday": false, ............. }, "2": { "dayOfWeek": ...

Encountering a hiccup during the installation process of Angular CLI

I'm encountering an issue in the command line, seeking assistance C:\Users\admin>npm -v 6.9.0 C:\Users\admin>npm install -g @angular/cli npm ERR! Unexpected end of JSON input while parsing near '...vkit/core":"8.0.4", ...

No bugs appeared in Next.js

I am currently in the process of migrating a large create-react-app project to NextJS. To do this, I started a new Next project using create-next-app and am transferring all the files over manually. The main part of my page requires client-side rendering f ...

Can a single data type be utilized in a function that has multiple parameters?

Suppose I have the following functions: add(x : number, y : number) subtract(x : number, y : number) Is there a way to simplify it like this? type common = x : number, y : number add<common>() This would prevent me from having to repeatedly define ...

Can you explain Angular's "rule of unidirectional data flow" to me?

The concept of Angular's "unidirectional data flow rule" is mentioned throughout various sections of the Angular documentation, yet a clear and concise definition of this rule is nowhere to be found. After thorough research, I discovered two somewhat ...

What could be the reason for ng serve malfunctioning when the project cli version is v9 and the global cli version is v11

After setting up angular project with cli version 9, I encountered an issue due to having global cli version 11. When attempting to run "ng serve", the following error message appeared: The current version of CLI is designed to work with Angular version ...

What is the reason TypeScript struggles to automatically deduce assignments of identical object types?

Imagine a scenario with a simple code snippet to illustrate the issue: interface I { n?: number; s?: string; } const a: I = { n: 1, } const b: I = { n: 2, s: 'b', } const props = ['n', 's'] as const; for (const p ...

Stop openapi-generator from altering enum names in JavaScript/TypeScript

We have implemented the openapi generator to create our REST client and it has been quite effective. However, we encountered an issue when using enums in the format UPERCASE_UNDERSCORE, as it ended up removing the underscores which caused inconvenience. Th ...

Fullcalendar in Angular fails to update events automatically

I am exploring the integration of fullcalendar with angular. Despite adding valid events to my events field, they are not displaying in the UI. However, hardcoded events are appearing. I am relatively new to angular, so the issue may not be directly relat ...

Tips for adding a class to the end of the DOM class

Greetings! I'm currently working with the code below: for ( let x: number = 0; x < this._vcr.element.nativeElement.querySelectorAll(".ui-steps-item").length; x++) { let className: any = this._vcr.element.nativeElement.querySelectorAll( ...

Value of type 'string' cannot be assigned to type '{ model: { nodes: []; links: []; }; }'

I am a beginner in TypeScript and I have added types to my project. However, I am encountering an error with one of the types related to the graph: Type 'string' is not assignable to type '{ model: { nodes: []; links: []; }; }'.ts(2322) ...

Angular 6: Implementing dynamic input fields to replace specific strings within an HTML string

I need assistance in dynamically replacing placeholders within an HTML string retrieved from an HTTP service. The HTML string is as follows: When uranium was {{1}} to be radioactive, Marie Curie found that the element called {{2}} had the same property. ...

Transmitting HTML content to the browser from the client using Node.js

Quoted from: Book - "Getting MEAN with Mongo, Express.." When it comes to responding to requests in your application by sending HTML to the browser, Express simplifies this process compared to native Node.js. With support for various templating e ...

The production build was unsuccessful due to issues with pdfmake during the ng build

Currently, I am working on an Angular 6.1.4 project using pdfmake 0.1.63 (also tested with version 0.1.66). While running ng build --prod command, I have encountered the following issue: ERROR in ./node_modules/pdfmake/build/pdfmake.js ...

Nest JS Guards - Employ either of two approaches

I have implemented two different JWT based strategies in my application: The first strategy involves single sign-on for organization members, where an external provider generates a JWT. The second strategy is for email/password authenticated external user ...

Steps for transforming an Electron application into a single packager installer (executable-only) on a Linux system

I successfully developed a Desktop app for Linux along with the necessary supporting files. I am now looking to convert it into a single executable file, so that it can be easily shared with others. Is there a method to create an executable file from thi ...

The phrase 'tsc' is not identified as a valid cmdlet, function, script file, or executable program

Recently, I attempted to compile a TypeScript file into a JavaScript file by installing Node.js and Typescript using the command "npm install -g typescript". However, when I tried to compile the file using the command tsc app.ts, an error occurred: tsc : T ...

Having trouble transmitting Authorization header to Node 11 / Express 4 server from Angular 7

When trying to send the Authorization header using a GET request from my angular frontend to my node backend, both running on the same VPS, I encounter an issue. In order to make the request from angular, I use: return this.httpClient.get<ApiResponse& ...