FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
fractional-indexing: Implementing Drag-and-Drop Ordering and Avoiding Index Collisions
How-ToWeb Development

fractional-indexing: Implementing Drag-and-Drop Ordering and Avoiding Index Collisions

via Dev.to WebdevKendrick B. Jung4h ago

Avoiding index collisions in sortable lists The limits of integer indices If you have ever built a drag-and-drop list, you have probably stored the order like this. [ { "id" : "a" , "order" : 1 }, { "id" : "b" , "order" : 2 }, { "id" : "c" , "order" : 3 } ] What happens if you move b to the front? b becomes 0, and a is still 1, so at first glance it seems fine. But if you later want to insert a new item between a and b , you have to shift a to 2 and c to 3. In other words, changing one item often forces you to update several others too. In collaborative tools where multiple users can reorder items at the same time, that structure tends to create collisions. If two people modify the same part of the list concurrently, the final order can become inconsistent or trigger large update conflicts. What is fractional-indexing? David Greenspan introduced this approach in Implementing Fractional Indexing . The core idea is simple: instead of using integers for order, use sortable string keys . [

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
0 views

Related Articles

Developer Leave Planning: How to Handoff Projects Before FMLA Starts
How-To

Developer Leave Planning: How to Handoff Projects Before FMLA Starts

Dev.to • 4h ago

Engineering Principles for Life, Not Just for Code
How-To

Engineering Principles for Life, Not Just for Code

Medium Programming • 4h ago

Best Laptops (2026): My Honest Advice Having Tested Hundreds
How-To

Best Laptops (2026): My Honest Advice Having Tested Hundreds

Wired • 5h ago

GE Profile Smart Grind and Brew Review: Just the Basics
How-To

GE Profile Smart Grind and Brew Review: Just the Basics

Wired • 7h ago

How I Would Learn Data Engineering in 2026 If I Started From Zero
How-To

How I Would Learn Data Engineering in 2026 If I Started From Zero

Medium Programming • 11h ago

Discover More Articles