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

Use Data Grid density for DataGridToolbar's density #3337

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

juliawegmayr
Copy link
Contributor

@juliawegmayr juliawegmayr commented Feb 4, 2025

Description

At the moment it is necessary to pass the density prop twice: once to the DataGrid and once to the DataGridToolbar.
The DataGridToolbar should not get the prop anymore, but instead use the density of the DataGrid.

  • Get density in DataGridToolbar from 'useGridApiContext'
  • Set height depending on the density value
  • Set density prop to deprecated

Acceptance criteria

Screenshots/screencasts

Standard:
Screenshot 2025-02-04 at 09 47 21

Compact:
Screenshot 2025-02-04 at 09 47 49

Comfortable:
Screenshot 2025-02-04 at 09 47 37

Open TODOs/questions

  • Add changeset

Further information

@juliawegmayr juliawegmayr force-pushed the datagrid-toolbar-density branch from 7f61619 to 4fa334a Compare February 4, 2025 08:46
@juliawegmayr juliawegmayr marked this pull request as ready for review February 4, 2025 08:49
@auto-assign auto-assign bot requested a review from johnnyomair February 4, 2025 08:49
const ownerState: OwnerState = {
density,
density: gridDensity || density,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This fallback won't work because you provide a fall back in L61


Deprecate `density` prop of `DataGridToolbar`

The usage of the `density` prop in `DataGridToolbar` is now deprecated as DataGrid now controls the styling of DataGridToolbar based on its density setting.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
The usage of the `density` prop in `DataGridToolbar` is now deprecated as DataGrid now controls the styling of DataGridToolbar based on its density setting.
The density setting of the surrounding Data Grid now controls the styling of the toolbar.

@johnnyomair johnnyomair changed the title Datagrid toolbar density Use Data Grid density for DataGridToolbar's density Feb 4, 2025
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