[PR #662] [CLOSED] feat(react): support textarea onInput callbacks #694

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

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/662
Author: @remorses
Created: 2/10/2026
Status: Closed

Base: mainHead: fix-textarea-oninput


📝 Commits (2)

  • ad7b5a6 feat(react): support textarea onInput callbacks
  • 5c43e8b refactor(react): decouple textarea onInput from onContentChange

📊 Changes

3 files changed (+94 additions, -0 deletions)

View changed files

📝 packages/react/src/types/components.ts (+1 -0)
📝 packages/react/src/utils/index.ts (+24 -0)
packages/react/tests/textarea-events.test.tsx (+69 -0)

📄 Description

What

  • Add onInput support for React <textarea>.
  • Wire it directly to textarea content changes in the React renderer.

Why

  • onInput was mapped for <input> but not <textarea>.
  • Consumers had to use onContentChange + ref.current?.plainText, which is easy to make stale in app update flows (we hit this while fixing critique dropdown search).

Scope

  • Minimal change: textarea onInput listens to editBuffer content-changed.
  • No behavior change to onContentChange.

Tests

  • Added packages/react/tests/textarea-events.test.tsx.
  • Verifies latest text for both single-line and multiline edits.

🔄 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/662 **Author:** [@remorses](https://github.com/remorses) **Created:** 2/10/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-textarea-oninput` --- ### 📝 Commits (2) - [`ad7b5a6`](https://github.com/anomalyco/opentui/commit/ad7b5a6e22cedf78f58d1232a4c56a8a1520a8bf) feat(react): support textarea onInput callbacks - [`5c43e8b`](https://github.com/anomalyco/opentui/commit/5c43e8bc51dd6b6b795f6114010ac9563281e5a2) refactor(react): decouple textarea onInput from onContentChange ### 📊 Changes **3 files changed** (+94 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/react/src/types/components.ts` (+1 -0) 📝 `packages/react/src/utils/index.ts` (+24 -0) ➕ `packages/react/tests/textarea-events.test.tsx` (+69 -0) </details> ### 📄 Description ### What - Add `onInput` support for React `<textarea>`. - Wire it directly to textarea content changes in the React renderer. ### Why - `onInput` was mapped for `<input>` but not `<textarea>`. - Consumers had to use `onContentChange` + `ref.current?.plainText`, which is easy to make stale in app update flows (we hit this while fixing critique dropdown search). ### Scope - Minimal change: textarea `onInput` listens to `editBuffer` `content-changed`. - No behavior change to `onContentChange`. ### Tests - Added `packages/react/tests/textarea-events.test.tsx`. - Verifies latest text for both single-line and multiline edits. --- <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:42 +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#694
No description provided.