Back to Signal Feed
CodeTracked since May 17, 2026

Fix stale editor selection after delete and cut operations

The PR updates the editor input flow so delete- and cut-related input events always clear React selection state, preventing the selection from staying visually selected after text removal.

handleInputuse-editor-textarea-input.tsdeleteContentBackwarddeleteByCut

What Happened

  • The PR updates the editor input flow so delete- and cut-related input events always clear React selection state, preventing the selection from staying visually selected after text removal.
  • The PR updates the editor input flow so delete- and cut-related input events always clear React selection state, preventing the selection from staying visually selected after text removal.
  • 1 evidence item attached for review.

What is Different

Before

Scattered source updates, isolated context, and manual follow-up across multiple feeds.

Now

In `src/features/editor/hooks/use-editor-textarea-input.ts`, the input handler now treats deletion-related `InputEvent` types as unconditional selection-reset paths, so stale DOM-based selection bounds are not restored into React state after deletion; this directly addresses the visual persistence of a selected range after Backspace/Delete/Cut.

Why Track This

Why It Matters

Users deleting text in athas editor flows will see the selection collapse correctly after removal, so typing continues at the expected cursor point instead of acting on a visually stale selection state, and teams should keep monitoring cross-browser delete/cut edge cases for any remaining selection desync. In practice, the change avoids a misleading cursor/selection state that could cause accidental extra edits, especially where browser engines (notably WebKit) report inconsistent selection bounds; continued verification is needed on less-covered input paths and future DOM engine behavior.

Impact

Users deleting text in athas editor flows will see the selection collapse correctly after removal, so typing continues at the expected cursor point instead of acting on a visually stale selection state, and teams should keep monitoring cross-browser delete/cut edge cases for any remaining selection desync. In practice, the change avoids a misleading cursor/selection state that could cause accidental extra edits, especially where browser engines (notably WebKit) report inconsistent selection bounds; continued verification is needed on less-covered input paths and future DOM engine behavior.

What To Watch Next

  • Watch whether handleInput becomes a repeated pattern.
  • Track follow-up changes around AI Integration in IDEs.
  • Compare future signals against this evidence trail.
  • Re-check risk flags: webkit_selection_regression, other_input_event_regressions.
Open Topic TimelineOpen Technical EventOpen Original Sourcewebkit_selection_regression / other_input_event_regressions / browser_specific_selection_behavior

Supporting Evidence