Selection toolbar does not follow scrolling inside the WYSIWYG editor

Abierto
#1,450 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
react, typescript
Área
frontend

Línea de trabajo

Start by reproducing the issue in the Playground using WYSIWYG mode and the .g-md-wysiwyg-editor__editor scroll container described in the steps. Trace how the selection toolbar tracks the selected text while the editor scrolls, comparing that behavior with page scrolling. Done when the toolbar follows the selection during editor scrolling without breaking the page-scroll behavior.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Summary

On main, the selection formatting toolbar stays at its old position when scrolling inside the WYSIWYG editor. Scrolling the page moves the toolbar correctly.

Environment

  • Branch: main, commit b6334207f0eca9f565aecce987cf6bd1cbe0fd36.
  • Editor: 15.50.0; UIkit: 7.39.0, using the committed lockfile.
  • Chromium 152.0.7977.169 on macOS; viewport: 1100 × 560 CSS pixels.
  • Clean checkout; no editor source changes.

Steps to reproduce

  1. Install dependencies and start the demo:
    pnpm install --frozen-lockfile
    pnpm exec nx build-deps @markdown-editor/demo
    pnpm start
    
  2. Open Playground in WYSIWYG mode and replace the content with 30 paragraphs of plain text. The recording uses numbered copies of:

    Paragraph 01. Select this sentence to open the formatting toolbar, then scroll inside the editor.

  3. In the story frame's DevTools console, limit the editor's scroll container:
    document.querySelector('.g-md-wysiwyg-editor__editor').style.maxHeight = '300px';
    
  4. Double-click a word in paragraph 5 to open the selection toolbar.
  5. Keep the pointer over the editor and scroll down by approximately 100 px with the mouse wheel or trackpad.

Expected

The selection toolbar follows the selected text as the editor scrolls.

Actual

The selected text moves up, while the toolbar stays at its original screen position.

The reproduction used browser wheel input. Measurements are in CSS pixels:

State Editor scroll Page scroll Selection top Toolbar top
Before scrolling 0 0 340 362.5
After editor scrolling 100 0 240 362.5
Page-scroll control, editor reset 0 100 240 262.5

Recording

Recorded on the main checkout above. The video scrolls the editor down, returns it to the top, then scrolls the page.

https://github.com/user-attachments/assets/213dd821-8428-428c-af2f-84f721d58eb9

Screenshots

Before scrolling: the toolbar is directly below the selected word.

Before scrolling

Editor scrolled by 100 px: the selection moved up; the toolbar stayed in place.

After scrolling inside the editor

Page-scroll control: after resetting the editor scroll, scrolling the page by 100 px moves both the selection and toolbar together.

Page-scroll control

Lenguaje dominante
TypeScript
Estrellas
428
Forks
48
Merge medio
5 d 15 h
PR fusionados (30 d)
47

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de gravity-ui/markdown-editor

Todos los issues de gravity-ui/markdown-editor

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.