[PR #123] [MERGED] Pass through mouse down event when starting selection #1083

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

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/123
Author: @kommander
Created: 9/2/2025
Status: Merged
Merged: 9/2/2025
Merged by: @kommander

Base: mainHead: fix-select-on-drag


📝 Commits (3)

📊 Changes

2 files changed (+5 additions, -1 deletions)

View changed files

📝 packages/core/src/examples/mouse-interaction-demo.ts (+3 -1)
📝 packages/core/src/renderer.ts (+2 -0)

📄 Description

When a renderable is selectable, it will start the selection, but pass through the mousedown event, so when releasing the button immediately, no selection happens and mousedown can be handled by the renderable. To avoid actually selecting the text in a text renderable one still has to set selectable=false, for a button component for example. So you can have both.

Should solve #112


🔄 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/123 **Author:** [@kommander](https://github.com/kommander) **Created:** 9/2/2025 **Status:** ✅ Merged **Merged:** 9/2/2025 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `fix-select-on-drag` --- ### 📝 Commits (3) - [`fd49cd6`](https://github.com/anomalyco/opentui/commit/fd49cd65aee3e8765c5edbc942f29d9669af130e) stash - [`275a193`](https://github.com/anomalyco/opentui/commit/275a1937d49908e4c6e00c729b836c9e43b42859) revert - [`bccc8a4`](https://github.com/anomalyco/opentui/commit/bccc8a48bfe1cbff665596391c25ce2ab649c1f9) pass through mousedown event when starting selection ### 📊 Changes **2 files changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/examples/mouse-interaction-demo.ts` (+3 -1) 📝 `packages/core/src/renderer.ts` (+2 -0) </details> ### 📄 Description When a renderable is `selectable`, it will start the selection, but pass through the `mousedown` event, so when releasing the button immediately, no selection happens and `mousedown` can be handled by the renderable. To avoid actually selecting the text in a text renderable one still has to set `selectable=false`, for a button component for example. So you can have both. Should solve #112 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 09:17:33 +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#1083
No description provided.