Skip to content

fix: stabilize search results order during element drag - #10654

Open
VedantMadane wants to merge 2 commits into
excalidraw:masterfrom
VedantMadane:fix-search-results-stable-order
Open

VedantMadane wants to merge 2 commits into
excalidraw:masterfrom
VedantMadane:fix-search-results-stable-order

Conversation

@VedantMadane

Copy link
Copy Markdown

Summary

  • Fixes search results reordering when elements are dragged on canvas
  • Changes sorting from Y-position-based to ID-based for stable ordering

Details

When searching for elements and then dragging one of the matched elements, the search results list would reorder because results were sorted by Y position. As the element's Y position changed during drag, the sort order changed, causing the UI to jump around.

The fix changes the sorting to use element IDs instead, which provides a stable, deterministic order that doesn't change during drag operations.

Test plan

  1. Add \ est 1\ and \ est 2\ text elements
  2. Open search (Ctrl/Cmd+F)
  3. Search for \ est\`n4. Drag one of the elements around
  4. Verify the search results list no longer reorders

Fixes #9503

@vercel

vercel Bot commented Jan 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Jun 28, 2026 6:14pm
excalidraw Ready Ready Preview Jun 28, 2026 6:14pm
excalidraw-package-example Ready Ready Preview Jun 28, 2026 6:14pm
excalidraw-package-example-with-nextjs Ready Ready Preview Jun 28, 2026 6:14pm

Request Review

@VedantMadane

Copy link
Copy Markdown
Author

Small fix to stabilize search result order while dragging elements. Vercel previews are up. Light review welcome when you have a moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

canvas search results unstable

1 participant