Page MenuHomePhabricator

Standalone: Floating toolbar fails when page gets too long with keyboard-only input in minimal demo
Closed, ResolvedPublic1 Story Points

Description

Try it on https://wikimedia.github.io/VisualEditor/demos/ve/minimal.html

  1. Enter new lines in editor until the page starts to scroll vertically
  2. Observe the toolbar becoming a vertical mess on the top left of the page
  3. Bonus: With jquery3 obtain an exception due to a call of offset() on a non-DOM element.

The problem originates from toolbar initialization happening in addSurface(), but the element needs to be in the DOM to initialize element offsets properly.

A solution is to add the Target to the DOM before adding the Surface. See https://github.com/wikimedia/VisualEditor/blob/9be803f37cff257d11f563f07573204d23cf2053/demos/ve/demo.minimal.js#L25-L26

These lines should move up to line 16.

Event Timeline

Ypnos42 created this task.Dec 9 2016, 3:09 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 9 2016, 3:09 PM
Jdforrester-WMF renamed this task from Floating toolbar fails in minimal example to Standalone: Floating toolbar fails when page gets too long with keyboard-only input.Dec 9 2016, 10:52 PM
Jdforrester-WMF triaged this task as Low priority.
Jdforrester-WMF set the point value for this task to 1.
Jdforrester-WMF moved this task from To Triage to TR3: Language support on the VisualEditor board.
Jdforrester-WMF added a subscriber: Esanders.

Change 332875 had a related patch set uploaded (by Esanders):
Fix minimal demo

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

Jdforrester-WMF renamed this task from Standalone: Floating toolbar fails when page gets too long with keyboard-only input to Standalone: Floating toolbar fails when page gets too long with keyboard-only input in minimal demo.Jan 18 2017, 9:57 PM
Jdforrester-WMF closed this task as Resolved.
Jdforrester-WMF assigned this task to Esanders.
Jdforrester-WMF edited projects, added Documentation; removed Patch-For-Review.
Jdforrester-WMF updated the task description. (Show Details)

Change 332875 merged by jenkins-bot:
Fix minimal demo

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

Change 332879 had a related patch set uploaded (by Jforrester):
Update VE core submodule to master (6eba2e2)

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

Change 332879 merged by jenkins-bot:
Update VE core submodule to master (6eba2e2)

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