Page MenuHomePhabricator

Fix two bugs with DraggableList
ClosedPublic

Authored by epriestley on Jan 12 2014, 10:51 PM.
Tags
None
Referenced Files
F19081237: D7939.id.diff
Tue, Dec 2, 4:46 AM
F19073460: D7939.diff
Mon, Dec 1, 2:02 AM
F19032271: D7939.diff
Tue, Nov 25, 5:47 AM
F18983873: D7939.diff
Mon, Nov 17, 10:17 AM
F18848476: D7939.id.diff
Oct 30 2025, 4:55 AM
F18843939: D7939.diff
Oct 29 2025, 2:05 AM
F18774159: D7939.diff
Oct 9 2025, 3:34 PM
F18635600: D7939.diff
Sep 17 2025, 2:16 AM
Subscribers

Details

Summary

Ref T1344. This fixes two issues with DraggableList:

  • In lists which allowed it, you could drag the top item above itself and get a dashed-border ghost item. This didn't make sense and didn't behave well. Just don't treat this operation as valid.
  • In lists which allowed it, you could drag any non-top item to the topmost position, then drag it to an invalid position. The dashed-border ghost item would not be removed properly if this happend.
  • Also fix some minor leftovers with Celerity.
Test Plan
  • Dragged the first item above itself; now an invalid operation with no ghost.
  • Dragged another item to the first position then back to its original position; ghost vanishes.
  • Clean lint.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

webroot/rsrc/js/core/DraggableList.js
162–165

Note this for null vs false trickiness.

I tried to make a good joke about null, but I kept coming up false. (See how bad that was?)