Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-17793

Users cannot continue typing seamlessly after inserting a mention with the '@' shortcut

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 12.7
    • Fix Version/s: None
    • Component/s: Mentions
    • Labels:
      None
    • Difficulty:
      Unknown
    • Similar issues:

      Description

      Currently, when a mention is inserted with the '@' shortcut, the inserted macro is selected in CKEditor, and the user needs to press the right arrow to move the caret at the end of the text and continue typing.

      The UX can be improved by instead:

      • Insert an single space as the return value of outputTemplate
      • on the afterInsertHtml event:
      • move the caret at the left of the inserted space
      • call the xwiki-macro-insert command to insert the macro
      • wait for afterCommandExec (see code below) and move the caret just after the inserted mention macro
      var handler = editor.once('afterCommandExec', function(event) {
        if(event.data.name === 'xwiki-macro-insert') {
          handler.removeListener();
          // TODO....    
        }
      });

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              mleduc Manuel Leduc
              Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Date of First Response: