By definition offsetTop returns the top position of the object
relative to the top side of its offsetParent element, in pixels.
Now offsetParent needs to be an element with a position other than
static. If you change the position attribute of scroll element in your
fiddle I get a value of 1012 as opposed to 1110 without the position
attribute.
Therefore, remove the relatie position specifier for .sceditor-container` from the CSS file.
Now, the dropdown is relative to the doucment's body, and must be moved. Fortunately, editor.createDropDown() can be overridden via a simple plugin
sceditor.plugins.fix = function ()
{
let editor;
this.init = function ()
{
editor = this;
const fn = editor.createDropDown;
this.createDropDown = function (menuItem, name, content) {
fn(menuItem, name, content);
document.body.appendChild(document.querySelector('.sceditor-dropdown'));
};
};
};
From my question on Stack Overflow https://stackoverflow.com/questions/77738288/sceditor-dropdown-is-out-of-place
I eventually figured it out