[PR #724] scrollbox: add scrollChildIntoView method #739

Open
opened 2026-03-02 23:47:54 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/724
Author: @simonklee
Created: 2/21/2026
Status: 🔄 Open

Base: mainHead: scroll-into-view


📝 Commits (5)

  • 2eafa75 scrollbox: add scrollChildIntoView method
  • e3c3df3 Merge branch 'main' into scroll-into-view
  • 7df4ac3 Merge branch 'main' into scroll-into-view
  • d2cb577 Merge branch 'main' into scroll-into-view
  • 52a0978 Merge branch 'main' into scroll-into-view

📊 Changes

2 files changed (+200 additions, -0 deletions)

View changed files

📝 packages/core/src/renderables/ScrollBox.ts (+49 -0)
📝 packages/core/src/tests/scrollbox.test.ts (+151 -0)

📄 Description

Add a convenience API to keep a descendant visible without repeated
call-site math around viewport bounds and scroll deltas.

Use nearest alignment on both axes instead of DOM's default
block:start so keyboard navigation moves as little as possible.
Mirror CSSOM View nearest behavior for oversized children, including
no-op when an oversized child already intersects the viewport, to
avoid jumpy scrolling.

See https://drafts.csswg.org/cssom-view/#dom-element-scrollintoview

Fixes #716


🔄 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/724 **Author:** [@simonklee](https://github.com/simonklee) **Created:** 2/21/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `scroll-into-view` --- ### 📝 Commits (5) - [`2eafa75`](https://github.com/anomalyco/opentui/commit/2eafa75638614183af402f6198bf7d1782f8cb37) scrollbox: add scrollChildIntoView method - [`e3c3df3`](https://github.com/anomalyco/opentui/commit/e3c3df3b7e35ead7e5bffdf36859367dd41dfbd3) Merge branch 'main' into scroll-into-view - [`7df4ac3`](https://github.com/anomalyco/opentui/commit/7df4ac313307850fc2bf473bc43bf3c9db217c38) Merge branch 'main' into scroll-into-view - [`d2cb577`](https://github.com/anomalyco/opentui/commit/d2cb577daea3bd7f82801ae95464cfe1f72e9982) Merge branch 'main' into scroll-into-view - [`52a0978`](https://github.com/anomalyco/opentui/commit/52a09787ce4dc39c0fa258b996e85a63dcfdb5f9) Merge branch 'main' into scroll-into-view ### 📊 Changes **2 files changed** (+200 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/renderables/ScrollBox.ts` (+49 -0) 📝 `packages/core/src/tests/scrollbox.test.ts` (+151 -0) </details> ### 📄 Description Add a convenience API to keep a descendant visible without repeated call-site math around viewport bounds and scroll deltas. Use nearest alignment on both axes instead of DOM's default block:start so keyboard navigation moves as little as possible. Mirror CSSOM View nearest behavior for oversized children, including no-op when an oversized child already intersects the viewport, to avoid jumpy scrolling. See https://drafts.csswg.org/cssom-view/#dom-element-scrollintoview Fixes #716 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#739
No description provided.