mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-28 14:30:13 +00:00
Signed-off-by: Zoey <zoey@z0ey.de> Signed-off-by: Simon L. <szaimen@e.mail.de> Signed-off-by: Pablo Zmdl <pablo@nextcloud.com> Co-authored-by: Simon L. <szaimen@e.mail.de> Co-authored-by: Pablo Zmdl <pablo@nextcloud.com>
10 lines
382 B
JavaScript
10 lines
382 B
JavaScript
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});
|