Page MenuHomePhabricator

Fix two bugs with DraggableList
ClosedPublic

Authored by epriestley on Jan 12 2014, 10:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 24, 12:28 PM
Unknown Object (File)
Tue, Mar 5, 9:57 AM
Unknown Object (File)
Feb 10 2024, 3:14 PM
Unknown Object (File)
Feb 5 2024, 10:37 PM
Unknown Object (File)
Dec 25 2023, 11:10 AM
Unknown Object (File)
Dec 22 2023, 1:26 PM
Unknown Object (File)
Nov 25 2023, 8:51 AM
Unknown Object (File)
Nov 20 2023, 11:59 PM
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?)