Page MenuHomePhabricator

VisualEditor: SurfaceObserver sets selection to start of document after closing reference dialog in Chrome
Closed, ResolvedPublic

Description

  1. Edit an existing reference or insert a new one
  2. When the dialog is closed, the reference is selected and a callout is displayed
  3. 200ms later the selection moves to the start of the document

Somehow, for some reason, SurfaceObserver is "fixing" the selection here.


Version: unspecified
Severity: normal

Details

Reference
bz57034

Event Timeline

Happens on Chromium 25 but not on Firefox 24 (on my Ubuntu system).

When the reference is inserted, the CE cursor gets reset to the start (as always happens with a ContentEditable when you change the content). But then the CE cursor updates the DM cursor, whereas it should happen the other way round.

Evidence: Make SurfaceObserver.pollOnceInternal into a no-op, then right-cursor to a word and click Reference, Insert Reference. Then the CE cursor gets reset to the start of the document, whereas the DM cursor is still in the place where the reference appears.

  • This bug has been marked as a duplicate of bug 58090 ***