reppners / ngx-drag-drop

Angular directives using the native HTML Drag And Drop API
https://reppners.github.io/ngx-drag-drop/
BSD 3-Clause "New" or "Revised" License
307 stars 120 forks source link

Input select with mouse don't work in firefox #96

Closed DanielDias-Dev closed 2 years ago

DanielDias-Dev commented 3 years ago

Hello,

The event to click in a don't work in firefox. When i click within a the cursor stay in the last character of text and i can't put the cursor in another position of the text. The only way to select or move the cursor in the text of is with the keyboard. This hapned whithin the dragg zone:

whithin this div: <div class="field" *ngFor="let item of model;let i= index;" (dndStart)="onDragStart($event, item)" (dndCanceled)="onDragCanceled($event)" (dndMoved)="onDragged(item, model, 'move')" [dndEffectAllowed]="'all'" [dndDraggable]="item">

Someone know how i solve this bug of firefox? My version of angular is: 8.1.3 and "ngx-drag-drop": "^1.1.0",

Thankyou all

reppners commented 2 years ago

Are you having an <input> element within an <a>? Because <a> is draggable by default. You'd need to make the drag conditional or disable it for the <input>/<a> in order to enable text selection.

Repositioning the cursor by clicking was working fine for me in a quick test, but I don't know your element hierarchy. A sample or reproduction would help a lot!

reppners commented 2 years ago

Reopening when a reproduction/sample code is available.