[PR #539] [MERGED] feat(input): migrate to extend textarea #609

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

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/539
Author: @msmps
Created: 1/16/2026
Status: Merged
Merged: 1/17/2026
Merged by: @kommander

Base: mainHead: feat/input-migration-20260116100941


📝 Commits (7)

  • 0e0a8b3 refactor(input): extend textarea
  • 0417a5d refactor(input): minor tweaks
  • 54560b9 refactor(input): improve initial value handling and maxLength enforcement and prevent initial value setter
  • a0ad157 refactor(input): remove deprecated cursorPosition getter and setter in favor of cursorOffset
  • a81a211 Merge branch 'main' into feat/input-migration-20260116100941
  • 658cc25 Merge branch 'main' into feat/input-migration-20260116100941
  • d7fe746 test(input): switch out cursor position property

📊 Changes

3 files changed (+216 additions, -439 deletions)

View changed files

📝 packages/core/src/renderables/Input.test.ts (+63 -64)
📝 packages/core/src/renderables/Input.ts (+134 -373)
📝 packages/core/src/renderables/Textarea.ts (+19 -2)

📄 Description

Summary

Refactor InputRenderable to extend TextareaRenderable, eliminating ~200 lines of duplication.

Key changes:

  • Input now inherits text editing, cursor management, and key binding logic from Textarea
  • Action names aligned with Textarea conventions (line-home, line-end, backspace, delete)
    • BREAKING CHANGE?

Test Plan

  • Existing Input tests updated and passing
  • Manual test

🔄 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/539 **Author:** [@msmps](https://github.com/msmps) **Created:** 1/16/2026 **Status:** ✅ Merged **Merged:** 1/17/2026 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `feat/input-migration-20260116100941` --- ### 📝 Commits (7) - [`0e0a8b3`](https://github.com/anomalyco/opentui/commit/0e0a8b322b80e528b8f61f7d9017b804034c841a) refactor(input): extend textarea - [`0417a5d`](https://github.com/anomalyco/opentui/commit/0417a5d57707f1916482ac9672633a9a262302c3) refactor(input): minor tweaks - [`54560b9`](https://github.com/anomalyco/opentui/commit/54560b943a1de27ba239cc5f57d825af7ba81b08) refactor(input): improve initial value handling and maxLength enforcement and prevent initial value setter - [`a0ad157`](https://github.com/anomalyco/opentui/commit/a0ad1570629c7cecc3c8e4cc5475794edeae5f9b) refactor(input): remove deprecated cursorPosition getter and setter in favor of cursorOffset - [`a81a211`](https://github.com/anomalyco/opentui/commit/a81a21184ed52377637b0e5865c50141b4af4058) Merge branch 'main' into feat/input-migration-20260116100941 - [`658cc25`](https://github.com/anomalyco/opentui/commit/658cc2532e4dc55e08e6ad555cb75ff9089ce4f7) Merge branch 'main' into feat/input-migration-20260116100941 - [`d7fe746`](https://github.com/anomalyco/opentui/commit/d7fe746fe979f32a1664c649498628e69f02cd67) test(input): switch out cursor position property ### 📊 Changes **3 files changed** (+216 additions, -439 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/renderables/Input.test.ts` (+63 -64) 📝 `packages/core/src/renderables/Input.ts` (+134 -373) 📝 `packages/core/src/renderables/Textarea.ts` (+19 -2) </details> ### 📄 Description ## Summary Refactor `InputRenderable` to extend `TextareaRenderable`, eliminating ~200 lines of duplication. **Key changes:** - Input now inherits text editing, cursor management, and key binding logic from Textarea - Action names aligned with Textarea conventions (`line-home`, `line-end`, `backspace`, `delete`) - **BREAKING CHANGE?** ## Test Plan - [x] Existing Input tests updated and passing - [x] Manual test --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:47:20 +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#609
No description provided.