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

Add --rdg-scroll-height variable #3454

Merged
merged 10 commits into from
Mar 14, 2024
Merged

Add --rdg-scroll-height variable #3454

merged 10 commits into from
Mar 14, 2024

Conversation

amanmahajan7
Copy link
Contributor

@amanmahajan7 amanmahajan7 commented Feb 13, 2024

This can be useful to set grid height based on the number of rows. For example we can do something like

block-size: 100%;
max-height: var(--rdg-scroll-height);

@amanmahajan7 amanmahajan7 self-assigned this Feb 13, 2024
Copy link

codecov bot commented Feb 13, 2024

Codecov Report

Attention: Patch coverage is 78.57143% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 98.21%. Comparing base (94f8db4) to head (d5cd191).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3454      +/-   ##
==========================================
- Coverage   98.26%   98.21%   -0.06%     
==========================================
  Files          47       47              
  Lines        5077     5087      +10     
  Branches      724      724              
==========================================
+ Hits         4989     4996       +7     
- Misses         88       91       +3     
Files Coverage Δ
src/DataGrid.tsx 99.34% <100.00%> (+<0.01%) ⬆️
src/hooks/useGridDimensions.ts 81.25% <62.50%> (-4.47%) ⬇️

@amanmahajan7 amanmahajan7 changed the title Add --rdg-total-height variable Add --rdg-rows-height variable Feb 13, 2024
@amanmahajan7 amanmahajan7 marked this pull request as ready for review February 13, 2024 23:08
@amanmahajan7 amanmahajan7 deleted the am-grid-height branch February 14, 2024 16:18
@amanmahajan7 amanmahajan7 restored the am-grid-height branch February 14, 2024 17:45
@amanmahajan7 amanmahajan7 reopened this Feb 14, 2024
@amanmahajan7 amanmahajan7 requested a review from nstepien March 14, 2024 17:37
@@ -7,6 +7,7 @@ export function useGridDimensions() {
const gridRef = useRef<HTMLDivElement>(null);
const [inlineSize, setInlineSize] = useState(1);
const [blockSize, setBlockSize] = useState(1);
const [horizontalScrollbarWidth, setHorizontalScrollbarWidth] = useState(0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

width -> height

@amanmahajan7 amanmahajan7 changed the title Add --rdg-rows-height variable Add --rdg-scroll-height variable Mar 14, 2024
- set scrollbar height in resize observer callback
@amanmahajan7 amanmahajan7 merged commit 5bcf9d2 into main Mar 14, 2024
3 checks passed
@amanmahajan7 amanmahajan7 deleted the am-grid-height branch March 14, 2024 18:31
adityatoshniwal pushed a commit to pgadmin-org/react-data-grid that referenced this pull request Jul 31, 2024
* Add `--rdg-total-height` variable

* rename

* Handle scrollbar width

* `horizontalScrollbarWidth` -> `verticalScrollbarWidth`

* Revert "`horizontalScrollbarWidth` -> `verticalScrollbarWidth`"

This reverts commit 4dd2a87.

* Fix `horizontalScrollbarWidth`

* Rename to `--rdg-inner-height`

* - rename variables
- set scrollbar height in resize observer callback

* `innerHeight` -> `scrollHeight`
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 this pull request may close these issues.

2 participants