# ViewScrollToTheSelectionEvent

typedef

An event fired at the moment of [`scrollToTheSelection`](module_engine_view_view-EditingView.md#function-scrollToTheSelection) being called. It carries two objects in its payload (`args`):

* The first argument is the [object containing data](module_engine_view_view-ViewScrollToTheSelectionEventData.md) that gets passed down to the [`scrollViewportToShowTarget`](module_utils_dom_scroll.md#function-scrollViewportToShowTarget) helper. If some event listener modifies it, it can adjust the behavior of the scrolling (e.g. include additional `viewportOffset`).
* The second argument corresponds to the original arguments passed to [`scrollViewportToShowTarget`](module_utils_dom_scroll.md#function-scrollViewportToShowTarget). It allows listeners to re-execute the `scrollViewportToShowTarget()` method with its original arguments if there is such a need, for instance, if the integration requires re–scrolling after certain interaction.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/view/view.ts#L864)

<a id="properties">

## Properties

<a id="member-args">

### `args: [ ViewScrollToTheSelectionEventData, Parameters<EditingView[ 'scrollToTheSelection' ]>[ 0 ] ]`

<a id="member-name">

### `name: 'scrollToTheSelection'`

#### Value

`object`

## Fired by

* [EditingView#scrollToTheSelection](module_engine_view_view-EditingView.md#event-scrollToTheSelection)

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
