AUDIO
Source snapshot · 11 November 2026

Fixed-model virtual text list

Selection, keyboard and pointer lifetime

Up/Down/Home/End traverse copied enabled entries and bring active row into view. Single-mode unmodified destination movement selects; Ctrl/Meta only moves active. Multiple-mode movement only changes active, Space toggles and Shift movement forms an additive eligible range over the retained baseline. A genuine range boundary with no movement preserves an established anchor without creating or extending selection; nonrange movement clears it. Disabled initial selections are permitted for model continuity. Later snapshots may carry/remove those already selected disabled items but cannot newly add them. Scroll/refresh never prunes selected items. All-disabled model has activeIndex-1 and no root Tab/ref; explicit programmatic selection removal remains possible.

Ranges/toggles/programmatic sets exceeding 256 fail with Capacity before changing selection, active, anchor or notifying. Programmatic/keyboard Capacity failure also preserves pressed ownership. A rejected native Capacity click consumes its physical event phase but retains the same token identity and row pin; that consumed phase cannot accept a duplicate click. No partial range. Other invalid model requests return false without notification. Hidden/suspended viewport still accepts legal programmatic model updates; reveal reconciles rendering quietly. Focus/input admission additionally requires healthy geometry, root eligibility and actual original-document activeElement ownership.

Original-document pointerdown capture snapshots candidate identity before cancelling any prior token, including prevented, Alt or untrusted fresh intent. Candidate must still map to the same row after refresh; cancellation/recycling cannot reinterpret the new target. Pointer selection requires a trusted primary PointerEvent pointerdown, matching trusted pointerup, then matching trusted PointerEvent click pointer ID on the same owned row/index/modelID/namespace. Press pins that exact node through the native click; it is never recycled in between. Native default row focus is retained, then valid click restores root before selection. Current clipped row and viewport bounds and root focus must still admit the click. Pointerup over another row cancels the press and cannot select its recycled identity. Duplicate click, click with no valid token, synthetic/no-pointer click, prevented/modified unowned input and stale detached events cannot bypass admission. Keyboard or programmatic methods provide explicit stable-model alternatives.

Accepted keyboard/programmatic intent, including a recognized navigation boundary with no model movement, cancels an older press; rejected capacity transition preserves it. New pointerdown, matching pointercancel, outside press, owner window blur/hidden document or explicit cancelPointer() also cancels. Pointerup alone retains the pin if no matching click arrives. Retention is bounded one node, with no timeout/timer/document-wide tombstone. Consumers may explicitly cancel an abandoned pointer intention. Modifier click toggles; ordinary click replaces selection; unmodified Shift click adds a bounded range.

setSelected(indices,{notify:false}), setActive(index,{focus:false,scroll:true}), refresh(), selection(), activeIndex(), renderedIndices(), lastError(), cancelPointer() and dispose() form the bounded API. refresh returns viewport readiness; selection() returns frozen selectedIndices/selectedIds, unavailableSelectedIds, activeIndex/activeId, or null for disposed/invalid root. renderedIndices is a frozen sorted array of at most 512. Callback adds source keyboard/pointer/programmatic and only fires on actual selected model changes. Diagnostics include Capacity,Unavailable,TooLarge,Coordinates,Geometry,Ownership, Collision,Focus,Callback/Lifecycle. Diagnostics describe the latest attempt; a later healthy refresh can clear them, except Capacity remains while its consumed token retains the pin.

Synchronous focus/render/callback reentry rejects; disposal remains legal. Every owned write checks disposal before continuing. Post-focus/callback ownership and required focus revalidate. An accepted notification cannot roll back the model or consumer external effects if callback throws, hides/reparents/removes the root or redirects focus; method returns false with retained committed-model boundary/diagnostic. Disposal clears callbacks/listeners/observers/pins, removes only owned spacer, releases retained free references and exactly restores owned root attributes/styles. Navigation can retire the old connected document without removing its root; cleanup skips the replaced/inaccessible WindowProxy and keeps original document/node cleanup local. Queued resize/mutation/scroll work after disposal is inert. Recreated wrappers get a new namespace; old detached events cannot reach their root handlers.