Module

utils/dom/scroll

@ckeditor/ckeditor5-utils/src/dom/scroll

module

Filtering

Functions

  • scrollAncestorsToShowTarget( target )

    Makes any page HTMLElement or Range (target) visible within its scrollable ancestors, e.g. if they have overflow: scroll CSS style.

    Parameters

    target : HTMLElement | Range

    A target, which supposed to become visible to the user.

  • scrollViewportToShowTarget( options.target, [ options.viewportOffset ] )

    Makes any page HTMLElement or Range (target) visible inside the browser viewport. This helper will scroll all target ancestors and the web browser viewport to reveal the target to the user. If the target is already visible, nothing will happen.

    Parameters

    options.target : HTMLElement | Range

    A target, which supposed to become visible to the user.

    [ options.viewportOffset ] : Number

    An offset from the edge of the viewport (in pixels) the target will be moved by when the viewport is scrolled. It enhances the user experience by keeping the target some distance from the edge of the viewport and thus making it easier to read or edit by the user.