Page MenuHomePhabricator

Inconsistent placement of special characters menu
Open, Needs TriagePublicBUG REPORT

Description

What is the problem?

The special characters menu when editing wikisource appears in different places.

Sometimes it appears below the wikitext editor text input (see the first screenshot). Sometimes it appears above the text input (see second screenshot).

I cannot see a pattern in when it appears where. If you keep refreshing the page the position changes. It might be a race condition.

Moreover, I have found that in Firefox it almost always is above the wikitext editor, which I assume is incorrect.

I don't know if any other wiki has this same menu.

Steps to reproduce problem
  1. Go to https://en.wikisource.org/w/index.php?title=Page:Stevenson_-_Strange_case_of_Dr._Jekyll_and_Mr._Hyde_(1886).djvu/92&action=edit
  2. Note position of menu below text area (it should have a dropdown saying "Insert")
  3. Keep refreshing the page

Expected behavior: Menu is where it was in step 2
Observed behavior: Menu sometimes moves

Environment

Wiki(s): https://en.wikisource.org MediaWiki 1.38.0-wmf.5 (rMW42a8fbc6a1d2) 23:37, 20 October 2021.

Screenshots (if applicable):

First screenshot, the menu where I believe it should be:

special_char_correct.png (499×1 px, 222 KB)

Second screenshot, (when viewing a diff on Chrome) it has moved above the text input:

special_char_chrome_diff.png (750×1 px, 260 KB)

Related Objects

Event Timeline

This special-characters menu is inserted by the charinsert gadget on English Wikisource. It seems that by default it prepends it to .mw-editTools:

if ( $( '#editpage-specialchars' ).length ) {
    placeholder = $( '#editpage-specialchars' )[0];
} else {
    placeholder = $( '<div id="editpage-specialchars"> </div>' ).prependTo( '.mw-editTools' )[0];
}
/* ... */
placeholder.parentNode.replaceChild( box, placeholder );

It looks like the position of .mw-editTools is changing according to some other load-order issue. I've not been able to replicate it moving at all on Firefox (it's at the top every time).