[PR #552] [MERGED] Fix node using itself as anchor resulting in incorrect ordering #1393

Closed
opened 2026-03-14 09:34:24 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/552
Author: @Adictya
Created: 1/19/2026
Status: Merged
Merged: 1/23/2026
Merged by: @kommander

Base: mainHead: fix-array-revarsal-resulting-in-wrong-order


📝 Commits (5)

  • 73c6a2a fix: add checks to make self anchoring no-op
  • 06db366 chore: remove only test isolation
  • d2c029e chore: control-flow test formatting
  • bd1e90e fix: update invalid anchor test
  • f532c70 Merge branch 'main' into fix-array-revarsal-resulting-in-wrong-order

📊 Changes

4 files changed (+82 additions, -6 deletions)

View changed files

📝 packages/core/src/Renderable.ts (+11 -2)
📝 packages/core/src/tests/renderable.snapshot.test.ts (+2 -4)
📝 packages/core/src/tests/renderable.test.ts (+28 -0)
📝 packages/solid/tests/control-flow.test.tsx (+41 -0)

📄 Description

Fixes an edge case where if the node itself is provided to insertBefore as anchor as well, the node gets inserted at the wrong index.

Issue got noticed in a testcase of reversing an array in solid and trigerring a re-render which didn't result in the correct item order.

Tests included at both core and solid level

Also makes non existing anchor a non fatal error.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/552 **Author:** [@Adictya](https://github.com/Adictya) **Created:** 1/19/2026 **Status:** ✅ Merged **Merged:** 1/23/2026 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `fix-array-revarsal-resulting-in-wrong-order` --- ### 📝 Commits (5) - [`73c6a2a`](https://github.com/anomalyco/opentui/commit/73c6a2aae8f67266b414ff47e237eb8d73e99040) fix: add checks to make self anchoring no-op - [`06db366`](https://github.com/anomalyco/opentui/commit/06db366a0fb2cd85bbc08545de8f548390e526e7) chore: remove only test isolation - [`d2c029e`](https://github.com/anomalyco/opentui/commit/d2c029e59a1e3301785e785c6999a350bb90b18c) chore: control-flow test formatting - [`bd1e90e`](https://github.com/anomalyco/opentui/commit/bd1e90ea21a944f0ccb7c1489bf70fef09ee4829) fix: update invalid anchor test - [`f532c70`](https://github.com/anomalyco/opentui/commit/f532c70b78c4edfa7d3d2be57125c000b74f0023) Merge branch 'main' into fix-array-revarsal-resulting-in-wrong-order ### 📊 Changes **4 files changed** (+82 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/Renderable.ts` (+11 -2) 📝 `packages/core/src/tests/renderable.snapshot.test.ts` (+2 -4) 📝 `packages/core/src/tests/renderable.test.ts` (+28 -0) 📝 `packages/solid/tests/control-flow.test.tsx` (+41 -0) </details> ### 📄 Description Fixes an edge case where if the node itself is provided to insertBefore as anchor as well, the node gets inserted at the wrong index. Issue got noticed in a testcase of reversing an array in solid and trigerring a re-render which didn't result in the correct item order. Tests included at both core and solid level Also makes non existing anchor a non fatal error. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 09:34:24 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#1393
No description provided.