Skip to content
Discussion options

You must be logged in to vote

Update: OK, I figured it out, it was simpler than I thought - the same Javascript can be used, except this time target the q-scrollarea__content instead of .nicegui-log:

def scroll_log(top: bool = True) -> None:
    element_type = "first" if top else "last"
    ui.run_javascript(f"""
        const logElement = document.querySelector('.q-scrollarea__content');
        if (logElement && logElement.{element_type}ElementChild) {{
            logElement.{element_type}ElementChild.scrollIntoView();
        }}
        """)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@evnchn
Comment options

evnchn Oct 13, 2025
Collaborator

Answer selected by Dr3wBr3w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants