GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Bug]: Drag selection in the editable Files panel breaks across virtualized scroll windows · Issue #39570 · pingdotgg/t3code

[Bug]: Drag selection in the editable Files panel breaks across virtualized scroll windows #39570

New issue
Copy link
New issue
Copy link
Closed
#39574
Closed
[Bug]: Drag selection in the editable Files panel breaks across virtualized scroll windows#39570
#39574
Copy link

Description

@ryush00
ryush00
opened on Nov 20, 2026
Issue body actions

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Open a project containing a long text or Markdown file (200+ lines, e.g. AGENTS.md).
  2. Open the file in the right-hand Files panel in its default editable source view (EditableFileSurface).
  3. Click and drag downward (or upward) to select text while scrolling past the virtualizer's 50-line window boundary (e.g. start around line 65 and drag down past line 150, or start around line 5 and drag down past line 150).
  4. Release the mouse and press Cmd/Ctrl+C.

Expected behavior

The drag selection stays continuous as the virtualizer shifts its mounted row window, the editor selection overlay highlights every selected line in view, and copying returns the full dragged range from the starting line to the pointer's final position.

Actual behavior

Every time <Virtualizer> shifts renderRange (every 50 lines scrolled), File.render() runs applyRowsToDOM() → Editor.__captureFocusForDOMReplacement() and Editor.__syncRenderView(), which does not check #isContentMouseDown:

  1. When the anchor line is still mounted in the new window (e.g. dragging from line 65 as the window shifts 1..150 → 51..200): #restoreReplacementFocus() / this.focus() calls #setWindowSelection({ start: pos, end: pos, direction: 0 }), collapsing the browser's active drag selection to a single caret. Chromium aborts the ongoing drag and restarts a fresh selection from the current pointer position on subsequent movement, repeating every 50 lines.
  2. When the anchor line unmounts on a window shift (e.g. dragging from line 5 as the window shifts 1..150 → 51..200): #restoreReplacementFocus() returns early when #getLineElement(primaryPosition.line) == null without clearing #focusRequest. Because #canReadNativeSelection() requires #focusRequest == null, all subsequent selectionchange events are ignored until the next pointerdown. Since the editor hides native ::selection (#0000) and paints only [data-selection-range], the selection highlight freezes and vanishes as you keep scrolling, and Cmd/Ctrl+C only copies up to the freeze point.
  3. Even without #focusRequest, selectionchange reads only the currently mounted DOM range without preserving the off-screen #selectionStart anchor once its row is unmounted.

Related: #15927 fixed virtualized selection/copying for the read-only Files preview (ReadOnlySourcePreview / SourceSelection), and #30825 tracks the read-only Diff panel. This report is specifically for the editable Files preview (EditableFileSurface / @pierre/diffs Editor).

Impact

Major degradation or frequent failure

Version or commit

main @ 272cd38

Environment

macOS, T3 Code web dev app (vp run dev, Chromium) and T3 Code Desktop

Logs or stack traces

Measured on main @ 272cd38379 dragging AGENTS.md from line 65 to line 145 (scrollTop 7268, mounted lines 101..217):
- overlayRanges: 95 (frozen at line 115; lines 132..145 in viewport have 0 visible selection highlight)
- copiedLines: 51 (8,676 chars, truncated at line 115 instead of continuing through line 145)

Screenshots, recordings, or supporting files

Before: drag selection cuts off after virtualizer shift

before.mp4

Workaround

Toggle Show rendered markdown (eye icon) for .md files, or open the file in an external editor.

Activity

  1. juliusmarminge
    closed this as completedin #39574on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.