mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-29 15:00:09 +00:00
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: szaimen <42591237+szaimen@users.noreply.github.com>
13 lines
496 B
JavaScript
13 lines
496 B
JavaScript
// SPDX-FileCopyrightText: 2026 Nextcloud GmbH <https://nextcloud.com>
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
const observer = new MutationObserver((records) => {
|
|
const node = records[0]?.addedNodes[0];
|
|
// Text nodes also appear here but can't be scrolled to, so we have to check for the
|
|
// function being present.
|
|
if (node && typeof(node.scrollIntoView) === 'function') {
|
|
node.scrollIntoView();
|
|
}
|
|
});
|
|
observer.observe(document, {childList: true, subtree: true});
|