mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 14:53:33 +00:00
[PM-14345] Enabling drag and drop for cipher fields (#12067)
* enabling drag and drop for cipher fields * adding drag and drop to totp and fido * removing code changes to wrong file * undoing uneeded change * Changes suggested by Shane * fixes * fixes * moving export to the correct spot --------- Co-authored-by: --global <>
This commit is contained in:
22
libs/angular/src/directives/text-drag.directive.ts
Normal file
22
libs/angular/src/directives/text-drag.directive.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Directive, HostListener, Input } from "@angular/core";
|
||||
|
||||
@Directive({
|
||||
selector: "[appTextDrag]",
|
||||
standalone: true,
|
||||
host: {
|
||||
draggable: "true",
|
||||
class: "tw-cursor-move",
|
||||
},
|
||||
})
|
||||
export class TextDragDirective {
|
||||
@Input({
|
||||
alias: "appTextDrag",
|
||||
required: true,
|
||||
})
|
||||
data = "";
|
||||
|
||||
@HostListener("dragstart", ["$event"])
|
||||
onDragStart(event: DragEvent) {
|
||||
event.dataTransfer.setData("text", this.data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user