Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

218
Views
Ember drag-and-drop setTimeout before drag starts

I have a draggable-object from Ember drag-and-drop library (https://github.com/mharris717/ember-drag-drop) that default behaves like dragStart is performed instantly. I need to force that object, to start drag when user holds mouse button down for some time, and I thought that I can do it in in dragStartAction method delivered by drag-and-drop library, but this solution don't work as expected. its still instant dragStart.

draggable-object from my hbs:

{{#draggable-object
  dragHandle=".js-dragHandle"
  overrideClass=classes
  tagName="tbody"
  content=this
  dragStartAction=(action "onDragStart")
  dragStartHook=(action "onDragStartHook")
  dragEndHook=(action "onDragEndHook")
  dragEndAction=(action "onDragEnd")
}}

onDragStart action:

  @action
  onDragStart(componentInstance, data) {
    setTimeout(() => {
      if (!this.selectedRowIds.includes(this.transaction.id)) {
        this.send("selectRow", this.transaction.id);
      }
      this.selectCoupledVoidPayments();
      this.transferTransactions.onDragStart(findComponentObject(componentInstance), this.selectedRowIds, data);
    }, 500);
  }

onDragStartHook action:

  @action
  onDragStartHook(event: Event) {
    this.transferTransactions.onDragStartHook(event);
  }

I was thinking that I can resolve that by using somehow custom delay helper like this, but this is prohibited in my place, and I don't even know that this will do the job.

{{#draggable-object
  dragHandle=".js-dragHandle"
  overrideClass=classes
  tagName="tbody"
  content=this
  dragStartAction=(action (delay "onDragStart"))
  dragStartHook=(action "onDragStartHook")
  dragEndHook=(action "onDragEndHook")
  dragEndAction=(action "onDragEnd")
}}

What am I doing wrong, or what is the correct way to implement delay in Ember drag-and-drop?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!