Toolbar is not floating as I scroll down in VE, Error in the console "Uncaught TypeError: Cannot read property 'center' of undefined"
Description
Details
Related Objects
- Mentioned In
- T160190: [Regression wmf.16] Context menus for items below the screen appear broken (no vertical height)
T160479: [Regression wmf.16] Cursor jumps to the beginning of the page after adding a focusable node
T154123: VisualEditor: when pasting wikified text from an article, the text style (including link) can't be modified - Mentioned Here
- T154123: VisualEditor: when pasting wikified text from an article, the text style (including link) can't be modified
T160479: [Regression wmf.16] Cursor jumps to the beginning of the page after adding a focusable node
rGVEDf6e399eed0a2: Merge "ve.ui.DesktopContext: Prevent hiding of the context popup" into wmf/1.29.
rGVEDac6d7031c6d8: Merge "ve.ui.DesktopContext: Prevent hiding of the context popup"
T160190: [Regression wmf.16] Context menus for items below the screen appear broken (no vertical height)
Event Timeline
It is in chrome, however you need to select a focusable node first and then scroll to get the error first time. After that, it will keep showing that error even if its not selected.
I also can't get the JS error after I select a focussable node, even on https://en.wikipedia.beta.wmflabs.org/wiki/User:RYasmeen_(WMF)/sandbox?veaction=edit :-(
I cannot persuade this to happen, either. Reading computerPosition, I don't see an obvious way for it to happen without really weird stuff occurring (i.e. the direction CSS property being something other than ltr or rtl on the popup $container).
@Ryasmeen: Could you say whether it's still happening for you, and provide a more explicit test-case for it if so? (Which element you're clicking on, etc.)
@DLynch: Sure, I was able to replicate it in both test2 and Beta on following pages:
https://test2.wikipedia.org/wiki/Universe
https://test2.wikipedia.org/wiki/User:RYasmeen_(WMF)
https://en.wikipedia.beta.wmflabs.org/wiki/User:RYasmeen_(WMF)/sandbox
So the steps are:
- Open VE for any of these pages. For example: https://en.wikipedia.beta.wmflabs.org/wiki/User:RYasmeen_(WMF)/sandbox
- After opening the page select the graph/gallery/map node.
3.Click on "Read" mode to close VE
4.Open VE again
5.Scroll
At this point, the error should appear in the console, the toolbar won't float.
Aha. This looks like it's fallout from T160190: [Regression wmf.16] Context menus for items below the screen appear broken (no vertical height).
The issue seems to be that when you leave-and-reenter VE, the popup instance persists, along with its copy of $container. But the $container it's using no longer exists, because it's the destroyed-surface from the previous VE session. As such, with a removed-from-DOM-and-thrown-away element, getting its CSS direction gives us an empty-string, which causes the error we see here.
Change 343217 had a related patch set uploaded (by DLynch):
[VisualEditor/VisualEditor] DesktopContext: on destroy, tell our popup to stop positioning
I was, in fact, slightly misleading in my previous statement. The popup instance is indeed thrown away, it's just that it sets up a scroll handler, and so exists in that context. The patch has it tear that down.
Change 343217 merged by jenkins-bot:
[VisualEditor/VisualEditor] DesktopContext: on destroy, tell our popup to stop positioning
So maybe FloatableElement should check if $floatableContainer is still attached, and short-circuit if not? PopupWidget already does that (for the attachedness of the popup itself).
Change 343224 had a related patch set uploaded (by Jforrester):
[mediawiki/extensions/VisualEditor] Update VE core submodule to master (ac6d7031c)
Change 343224 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor] Update VE core submodule to master (ac6d7031c)
Change 343228 had a related patch set uploaded (by Jforrester; owner: DLynch):
[VisualEditor/VisualEditor] DesktopContext: on destroy, tell our popup to stop positioning
Change 343228 merged by jenkins-bot:
[VisualEditor/VisualEditor] DesktopContext: on destroy, tell our popup to stop positioning
Change 343248 had a related patch set uploaded (by DLynch):
[oojs/ui] FloatableElement: Abort positioning if no longer attached
Change 343248 merged by jenkins-bot:
[oojs/ui] FloatableElement: Abort positioning if no longer attached
Change 343411 had a related patch set uploaded (by Jforrester):
[mediawiki/extensions/VisualEditor] Update VE core submodule to wmf/1.29.0-wmf.16 HEAD (rGVEDf6e399eed0a2)
Change 343411 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor] Update VE core submodule to wmf/1.29.0-wmf.16 HEAD (rGVEDf6e399eed0a2)
Mentioned in SAL (#wikimedia-operations) [2017-03-17T23:36:35Z] <catrope@tin> Synchronized php-1.29.0-wmf.16/extensions/VisualEditor/lib/ve: Fixes for T154123 T160479 T160190 T160197 (duration: 00m 42s)
