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

Realtime user list in CKEditor and wiki editor flickers when other users move the caret

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 16.10.0
    • Realtime
    • Unknown

    Description

      Steps to reproduce:

      1. On a page with several paragraphs of content, open the realtime editor in five browser tabs (can be the same user account).
      2. In one of the tabs, run the following snippet to simulate moving the cursor to a different element every second:
        {
          const editable = CKEDITOR.instances[Object.keys(CKEDITOR.instances)[0]].editable().$;
          const doc = editable.ownerDocument;
          let i = 0;
          globalThis.caretWalk = setInterval(() => {
            const blocks = editable.querySelectorAll('p, h1, h2, h3, li');
            if (blocks.length < 2) {
              return console.warn('Need at least two blocks in the content.');
            }
            const range = doc.createRange();
            range.selectNodeContents(blocks[i++ % blocks.length]);
            range.collapse(true);
            const selection = doc.defaultView.getSelection();
            selection.removeAllRanges();
            selection.addRange(range);
          }, 1000);
        }
        
      3. Observe the list of co-editors and the dropdown in another tab
      4. You can stop the code for moving the cursor with clearInterval(caretWalk)

      Expected result:

      There isn't any visible flickering as the list of co-editors stays the same.

      Actual result:

      The list flickers visibly every ~3 seconds as shown in the attached screen recording. Navigating the dropdown by keyboard focus doesn't really work as focus is reset every ~3 seconds.

      Attachments

        Issue Links

          Activity

            People

              MichaelHamann Michael Hamann
              MichaelHamann Michael Hamann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: