Scrolling & insertion

scrollTarget#

Type: false | string | HTMLElement

Default: false

Overrides which element Redactor treats as the scroll viewport for UI positioning.

When false, the browser window is used. Pass a CSS selector or an HTMLElement when the editor lives inside a scrollable panel, modal, or layout with its own overflow.

const app = Redactor('#entry', {
  scrollTarget: '#editor-scroll-panel'
});

contentInsert#

Type: 'start' | 'end'

Default: 'start'

Default edge of the editable root when block or HTML content is inserted without a usable caret or in-editor selection — for example programmatic inserter.insert() / inserter.insertBlock() while the editor is not focused.

  • 'start' — prepend before the first child of the editable root
  • 'end' — append to the editable root

Does not override normal insert-at-caret behavior when the selection is inside the editor.

const app = Redactor('#entry', {
  contentInsert: 'end'
});