Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Bug: Dragging an item back to it's original place does not update the ng-repeat comments in the view #82

Closed
@alexilyaev

Description

@alexilyaev

This results in a mismatch between the model and the view and leads to terrible things.

Test case:
http://plnkr.co/edit/uxwalNYGtgaJCrbJbJOJ?p=preview

Reproduction steps:

  1. Drag item "one" in place of item "two" and then back to it's original place (without releasing)
  2. Click the X button on item "one"

Result:
All items except "two" disappear, instead of just removing item "one".

Reason:
Something to do with the ng-repeat comments not updating in this situation.

I tried to hack a solution by making the model splice the changes on the change callback. Tracking the change index using ui.item.placeholder.index(), and it worked fine while dragging (showing real-time model updates while dragging), but ran into problems once I released the item.

Besides fixing the bug, I think it's logical to expect real-time updates of the model as the changes are being made while dragging.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions