Skip to content

AbortError thrown on fast drag/drop #641

@saracope

Description

@saracope

Describe the bug
When quickly dragging and dropping an item an AbortError is thrown which breaks further drag/drop functionality.

To Reproduce
Steps to reproduce the behavior:

  1. Using <ul {{sortable-group}}> with {{#each items as |item|}} <li {{sortable-item model=item}}>
  2. Drag an item quickly and release before animation completes
  3. Observe the console error:
AbortError: the user aborted a request.

Expected behavior
Transitions should gracefully cancel or resolve. No uncaught errors should be thrown.

Screenshots

Image

Additional context

  • The DOM node is not removed
  • The .is-dropping class is applied
  • Transition seems to be interrupted mid-flight
  • Seeing in Chrome and Safari
  • Happens with both ember-sortable implementations we have in the codebase
  • Patching sortable-item.js resolves the issue for me locally
      return transitionPromise;
    } catch (e) {
      if (e.name === 'AbortError') {
        return Promise.resolve();
      }
      throw e;
    }

Versions
ember-sortable: 5.3.3
ember: 4.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions