hierarchical-document-list icon indicating copy to clipboard operation
hierarchical-document-list copied to clipboard

Annoying double scrollbar on hierarchy document list.

Open apokaliptis opened this issue 11 months ago • 1 comments

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 avatar Mar 18 '24 22:03 apokaliptis

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 avatar Mar 19 '24 12:03 apokaliptis