Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annoying double scrollbar on hierarchy document list. #21

Open
apokaliptis opened this issue Mar 18, 2024 · 1 comment · May be fixed by #22
Open

Annoying double scrollbar on hierarchy document list. #21

apokaliptis opened this issue Mar 18, 2024 · 1 comment · May be fixed by #22

Comments

@apokaliptis
Copy link

apokaliptis commented Mar 18, 2024

Describe the bug

Annoying double scrollbar on hierarchy document list. May be related to issue #20, which I reported separately as I am unsure if they are related.

To Reproduce

Steps:

  1. Install hierarchical-document-list and add it to your structure following installation steps
  2. Run sanity dev (npm run dev) and in your browser, open the new structure page added to Sanity
  3. See error in browser console.

Expected behavior

To only have one scroll bar to navigate the hierarchy document list.

Screenshots

problem-demo

Which versions of Sanity are you using?

@sanity/cli (global)                3.34.0 (up to date)
@sanity/eslint-config-studio         3.0.1 (up to date)
@sanity/hierarchical-document-list   2.0.0 (up to date)
@sanity/icons                       2.11.2 (up to date)
@sanity/ui                          2.0.10 (up to date)
@sanity/vision                      3.34.0 (up to date)
sanity                              3.34.0 (up to date)

What operating system are you using?

Windows 11

Which versions of Node.js / npm are you running?

Node v21.7.0
NPM 9.1.2

Additional context

Display Resolution 3840 x 2160.
Scale is set to 250% in Windows Display settings (the recommended setting).
Tested on Firefox Developer Edition 124.0b9 (64-bit) and Chrome Version 122.0.6261.129 (Official Build) (64-bit).

@apokaliptis
Copy link
Author

apokaliptis commented Mar 19, 2024

It appears to be caused by the getTreeHeight function in the utils directory not calculating the height correctly. It assumes the "row height" to be 51px with a static constant, whereas on my computer it is 57px.

I'm not a React dev, however, I'll attempt a pull request once I'm confident with my fix.

@apokaliptis apokaliptis linked a pull request Mar 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant