VisualEditor: Inserting an existing reference in the first paragraph in Firefox puts it at the start of the paragraph, not where the cursor is
Closed, ResolvedPublic

Description

When an existing reference is inserted, it is put at the start of the paragraph the cursor is currently in, regardless of where it is in that paragraph. This has happened to me while I was attempting to use in a paragraph a reference that was already used in that paragraph: the reference got inserted at the start of the paragraph and I was not able to move it. I tried again some times but it still did not work and I had to use the wikitext editor.


Version: unspecified
Severity: normal

Rastus_Vernon created this task.Via LegacyJul 27 2013, 11:03 PM
jayvdb added a comment.Via ConduitJul 28 2013, 10:54 PM

I did only a quick test, and could not reproduce this bug. Could you give more detailed instructions?

Rastus_Vernon added a comment.Via ConduitJul 31 2013, 12:48 AM

I have done similar manipulations in other articles at some moments, and it seems it sometimes works and sometimes doesn't. There are many things that are strange concerning how the existing references system works.

Regardless, I set up a sandbox page on my user space, added a reference and then tried to re-use that reference using the VisualEditor. The reference was added at the start of the paragraph. I've done some more experimenting, and I've written steps to reproduce the bug; the first block reproduces the bug and the following blocks are other experimentations that give more strange results.

  1. Go to [[User:Rastus Vernon/VisualEditor Sandbox]].
  2. Edit the page with the VisualEditor.
  3. Click somewhere in the first paragraph, not at the start.
  4. Click on the reference button and re-use the reference (there is only one).
  5. Note how the reference was inserted at the start of the paragraph instead of being inserted where your cursor was.
  1. Click in another paragraph, not at the start.
  2. Insert the same reference again.
  3. Note how the reference was inserted at the right position.
  1. Perform steps 7 and 8 again.
  2. Note how it was again inserted at the right position, although the reference is already in that paragraph.
  1. Try inserting it again in the first paragraph.
  2. Note how it still inserts it at the start of the paragraph instead of inserting it in the right location.
  1. Be confused because you don't understand anything about this inconsistent behavior.
Thryduulf added a comment.Via ConduitAug 15 2013, 8:07 AM

At en.wp WhatamIdoing reports:
I was just trying to add the ref to the other sentences. It misplaced two copies at the start of the paragraph when I wanted one at the end of the first line of the first paragraph (perhaps I clicked too high on the top line of the edit window?). After I removed those, I couldn't add any more. Clicking the ref button did nothing." He gives the following URL:
https://en.wikipedia.org/w/index.php?title=Swing_%28seat%29&diff=568557479&oldid=568556853

Jdforrester-WMF added a comment.Via ConduitAug 16 2013, 12:06 AM

AFAICT this only happens in the first paragraph (and only in Firefox).

This is throwing an error in Rangy:

TypeError: sel.nativeSelection is null
sel._ranges.length = sel.rangeCount = sel.nativeSelection.rangeCount;

… but for some reason I can't get Firebug to give me a trace.

gerritbot added a comment.Via ConduitAug 20 2013, 5:22 PM

Change 80056 had a related patch set uploaded by Esanders:
Preserve selection when inserting references

https://gerrit.wikimedia.org/r/80056

gerritbot added a comment.Via ConduitAug 20 2013, 5:24 PM

Change 80056 merged by jenkins-bot:
Preserve selection when inserting references

https://gerrit.wikimedia.org/r/80056

Jdforrester-WMF added a comment.Via ConduitAug 20 2013, 5:25 PM

Should now be fixed; we will deploy this earlier than scheduled, later today.

Jdforrester-WMF added a comment.Via ConduitNov 25 2013, 10:17 AM
  • Bug 52594 has been marked as a duplicate of this bug. ***

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.