Point UI positioning at a custom scroll container (with overflow rule) instead of the window.
<div id="scroll-panel" style="height: 240px; overflow: auto;">
<div id="entry"></div>
</div>
const app = Redactor('#entry', {
content: [
'<h1>Editing inside a scroll panel</h1>',
'<p>Use <code>scrollTarget</code> when the editor lives inside a layout with its own overflow.</p>',
'<p>Scroll this panel and open a toolbar dropdown. Redactor keeps floating UI aligned with the selected content.</p>',
'<p>Add enough text to make scrolling obvious while menus stay in place.</p>'
].join(''),
scrollTarget: '#scroll-panel'
});