Skip to content

feat(text_editor): let a finger focus, place the caret and select - #67

Merged
Ericky14 merged 1 commit into
masterfrom
feat/text-editor-touch
Oct 30, 2026
Merged

Ericky14 merged 1 commit into
masterfrom
feat/text-editor-touch

Conversation

@Ericky14

@Ericky14 Ericky14 commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

A finger does nothing in a text_editor. On a touch laptop or a handheld, a tap in Slate's note body neither focuses it nor moves the caret, and there is no way to select text. text_input already handles touch.

Fix

  • A tap focuses the editor and puts the caret where the finger lands.
  • Two quick taps select a word, three select a line.
  • Dragging a finger selects, and stops at the editor's edge. A tap outside unfocuses it.
  • Ported from upstream iced-rs/iced#3442. No API change.

Testing

  • New widget/tests/text_editor_touch.rs (5 tests, touch events through the simulator): all pass; all 5 fail on master.
  • cargo lint and cargo fmt --check pass.
  • Slate against this branch, mount tests skipped: on tiny-skia only file_types fails, on the same 21 pptx, pdf and mp4 captures main gets wrong on this machine (LibreOffice and poppler). On wgpu, goldens and file_types failed under load in the full run and pass alone, as they do on iced master. No golden moved.

To try it:

  1. cargo test -p iced_widget --test text_editor_touch
  2. On a touch screen, tap, double-tap and drag in Slate's editor. Before this change nothing happens.

🤖 Generated with Claude Code

A finger now acts like the left mouse button: a tap, two or three quick
taps, and a drag. Port of upstream `iced-rs#3442`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Ericky14
Ericky14 merged commit 0ed6841 into master Oct 30, 2026
8 checks passed
@Ericky14
Ericky14 deleted the feat/text-editor-touch branch October 30, 2026 15:29
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.

1 participant