Skip to content

Conversation

evnchn
Copy link
Collaborator

@evnchn evnchn commented Jun 1, 2025

Motivation

While working on another PR, I noticed that the NiceGUI documentation kept throwing errors in the console, and I realized that the scroll-into-view functionality never worked for mobile users, since the DOM is not populated until the tree is expanded.

Implementation

  • Use ?. such that it doesn't throw an error, instead fails silently.
  • Run the scroll-into-view on toggling the left drawer.

Progress

  • I chose a meaningful title that completes the sentence: "If applied, this PR will..."
  • The implementation is complete.
  • Pytests have been added (or are not necessary).
  • Documentation has been added (or is not necessary).

Results

Before:

{5497DE04-201A-448D-9516-65AC9775660C}

-> Wrong scroll position, errors thrown

After:

{6B9B70DB-8718-4852-A5E7-3BBED9A3232F}

-> Correct scroll position, no errors

@evnchn evnchn changed the title Hierarchy scroll to fix Fix hierarchy scroll-to for mobile situation Jun 1, 2025
@evnchn evnchn added documentation Type/scope: Documentation, examples and website ⚪️ minor Priority: Low impact, nice-to-have labels Jun 1, 2025
@falkoschindler falkoschindler added the review Status: PR is open and needs review label Jun 2, 2025
@falkoschindler falkoschindler self-requested a review June 2, 2025 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Type/scope: Documentation, examples and website ⚪️ minor Priority: Low impact, nice-to-have review Status: PR is open and needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants