mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-24 20:45:56 +03:00
[GH-ISSUE #112] onMouseDown events do not fire when clicking a text node #795
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#795
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @remorses on GitHub (Aug 31, 2025).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/112
Currently when you click a text node inside a box no
onMouseDownevents are fired.Repro:
@msmps commented on GitHub (Aug 31, 2025):
ahh! i think this is a problem irrespective of where the node is placed in the tree! i think this is due to a conflict with the select logic here @kommander
you should be able to work around this at the moment @remorses by setting
selectableto false on the text node@kommander commented on GitHub (Aug 31, 2025):
Correct. When a node is selectable it currently swallows the mouse button event.
@remorses commented on GitHub (Aug 31, 2025):
I guess the best way to solve this would be to add an onClick event that fires on mouse over and only if the user did not drag the cursor more than n characters, like in the browser
@kommander commented on GitHub (Aug 31, 2025):
You mean on mouse up and only fire if not dragging? I think that could be solved then by starting text selection on drag, not on down, maybe.
Need to get that handler test covered.
@remorses commented on GitHub (Aug 31, 2025):
Yes that's also a good idea
I know John Carmack is very opinionated about this and would prefer that option much better 😆
https://x.com/ID_AA_Carmack/status/1787850053912064005
@kommander commented on GitHub (Sep 2, 2025):
For me this works #123, allowing both behaviours and selection is still instant on the cell where selection actually starts. And it's less complex.