Skip to content

Fix mid-text click in meeting notes and chat selection#3926

Merged
louis030195 merged 1 commit into
screenpipe:mainfrom
thisisharsh7:fix/text-selection-mid-sentence
Jun 9, 2026
Merged

Fix mid-text click in meeting notes and chat selection#3926
louis030195 merged 1 commit into
screenpipe:mainfrom
thisisharsh7:fix/text-selection-mid-sentence

Conversation

@thisisharsh7

@thisisharsh7 thisisharsh7 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

This PR fixes cursor placement and text selection being broken when clicking mid-sentence across the app in meeting notes editor, chat messages, and any .prose or contenteditable area.

The cursor would jump to the end of the line instead of landing where you clicked, and drag-selection from mid-sentence didn't work either.

Root cause: the selectstart handler in layout.tsx assumed e.target is always an Element, but mid-text clicks produce Text nodes which lack .closest(), so preventDefault() fired and blocked all mid-text selections.

Fixed by walking up to the parent Element for Text nodes before checking .closest()

fixes #3906
fixes #3772

Screen.Recording.2026-06-09.at.9.02.31.AM.mov
Screen.Recording.2026-06-09.at.9.04.25.AM.mov

@thisisharsh7 thisisharsh7 marked this pull request as ready for review June 9, 2026 04:17

@louis030195 louis030195 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apps/screenpipe-app-tauri/app/layout.tsx:323 — did you test this with markdown/prose editors too? @thisisharsh7

generated by the screenpipe pr-review pipe (https://screenpi.pe), not written by a human — reply and tag @louis030195 if it got something wrong.

@thisisharsh7

Copy link
Copy Markdown
Contributor Author

yes this is where the bug was found. tested cursor placement and drag selection mid-sentence in the meeting notes editor and chat assistant messages. Both work correctly now.

@louis030195 louis030195 merged commit 01388fb into screenpipe:main Jun 9, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug Report: Text Selection in Chat Is Inconsistent [bug] editor in ai note is buggy, cursor moving around etc

2 participants