-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Open
Labels
issue: bugIssue reporting a bugIssue reporting a bugseverity: highIf it breaks the basic use of the productIf it breaks the basic use of the productsource: core:content-managerSource is core/content-manager packageSource is core/content-manager packagestatus: pending reproductionWaiting for free time to reproduce the issue, or more informationWaiting for free time to reproduce the issue, or more informationversion: 5Issue is present in Strapi 5Issue is present in Strapi 5
Description
Bug report
Required System information
- Node.js version: 18
- NPM version: 8.19.2
- Strapi version: 4.10.6
- Is your project Javascript or Typescript: Javascript
Describe the bug
After inserting an image into editor, The cursor will jump to start of the editor.
Steps to reproduce the behavior
- Go to a component that has rich text editor
- Write a lorem document
- Go to the bottom of document
- Click on insert image from editor navbar
- Cursor will jump to the start!
Expected behavior
Text cursor should be on the beginning or the end of the line that image was inserted or the next line.
Additional context
strapi/packages/core/admin/admin/src/content-manager/components/Wysiwyg/utils/utils.js
Line 226 in 943497a
| setTimeout(() => editor.current.focus(), 0); |
The
focus should be followed by a setCursor like in here:strapi/packages/core/admin/admin/src/content-manager/components/Wysiwyg/utils/utils.js
Lines 196 to 200 in 943497a
| setTimeout(() => { | |
| const newLastLineLength = editor.current.getLine(currentLine).length; | |
| editor.current.focus(); | |
| editor.current.setCursor({ line: currentLine, ch: newLastLineLength }); | |
| }, 0); |
Metadata
Metadata
Assignees
Labels
issue: bugIssue reporting a bugIssue reporting a bugseverity: highIf it breaks the basic use of the productIf it breaks the basic use of the productsource: core:content-managerSource is core/content-manager packageSource is core/content-manager packagestatus: pending reproductionWaiting for free time to reproduce the issue, or more informationWaiting for free time to reproduce the issue, or more informationversion: 5Issue is present in Strapi 5Issue is present in Strapi 5
Type
Projects
Status
To be reviewed
Status
To triage