Skip to main content

cursor-position-tracker

Tracks and manages cursor position across text inputs, rich text editors, and custom selection interfaces. Handles IME composition and RTL text.

Informações da origem

Repositório
Fadil369/Solutions
Última atividade na origem
9 de abril de 2026 às 00:36
Idioma detectado do SKILL.md
inglês
Estrelas
1
Forks
0

Opções de instalação

Por padrão, está selecionado o prompt que primeiro revisa a origem. Você pode mudar para um comando direto ou baixar uma cópia local.

Revise os arquivos de origem

Leia o SKILL.md e os arquivos complementares exibidos pelo SkillsMP antes de decidir se vai instalar.

Exibindo SKILL.md

SKILL.md
Instruções da origem · Visualização somente leitura
name
Cursor Position Tracker
version
1.0.0
description
Tracks and manages cursor position across text inputs, rich text editors, and custom selection interfaces. Handles IME composition and RTL text.
author
workspace
activated
false
# Cursor Position Tracker Tracks and manages cursor position across text inputs, rich text editors, and custom selection interfaces. Handles IME composition and RTL text. ## Decision Framework ### When to Apply Use when: Rich text editors, custom input components, IME support needed, collaborative editing ### When NOT to Apply Don't use when: Simple form inputs with standard behavior ## Anti-Patterns ### 1. Breaking IME Composition ```javascript // BAD: Prevents character composition input.addEventListener('input', (e) => { formatText(); }); // GOOD: Wait for composition end let composing = false; input.addEventListener('compositionstart', () => composing = true); input.addEventListener('compositionend', () => { composing = false; formatText(); }); input.addEventListener('input', (e) => { if (!composing) formatText(); }); ``` ## Trigger Phrases - "Cursor position" - "Text selection" - "Rich text editor" - "IME support" - "Text input handling" ## Patterns ### Selection Manager ```javascript class SelectionManager { saveSelection() { const sel = window.getSelection(); if (sel.rangeCount > 0) return sel.getRangeAt(0).cloneRange(); return null; } restoreSelection(range) { if (!range) return; const sel = window.getSelection(); sel.removeAllRanges(); sel.addRange(range); } } ``` ## Integration - Works with: real-time-collaboration-engine, form-pattern-engine
Ver no GitHub