Skip to content

Moving cursor and selecting text is not working in headings inside Slate editor within CTs #7890

@sabrina-bongiovanni

Description

@sabrina-bongiovanni

Describe the bug
When adding a heading formatting to a Slate field (Richtext, etc.) inside a CT field, when clicking on the text to move the cursor or when trying to highlight text with the mouse does not work properly.
The selection gets stuck and does not change when selecting different words after doing it the first time. Also, if the user clicks on another part of the text to deselect the previous selection or to place the cursor, it won't move to the selected position.
This has been reported for Volto 17.
As of now, it is not possible to test it on Volto 18 as it is not possible to add headings to a RichText field inside a CT because of this issue: #7889
However, the code for Slate has not changed for this issue across versions so it's supposedly still there.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://demo.plone.org/
  2. Login and go to https://demo.plone.org/controlpanel/dexterity-types
  3. Create a custom CT for demo
  4. Click on the Actions menu
  5. Click on schema
  6. Add a "Richtext" type of field
  7. Create a new CT of the newly created type
  8. Add text to the Richtext field
  9. Select the text and click on the "Headings" buttons
  10. Try and select the heading text or move the cursor with your mouse.

Expected behavior
The selection should work seamlessly as it does on any other editor. By pointing and dragging the mouse, the selected text should be corresponding with the initial and final position of the mouse every time the user repeats this type of action. If text is selected and the user clicks on another position with the mouse once, the selection should be canceled and the cursor should move to the position where the click happened.

Screenshots
Image

(volto 17)

Software (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Volto Version: 17.x.x, 18.x.x (supposedly)
  • Plone Version: 6.x.x
  • Plone REST API Version: 9.15.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions