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

Deprecate virtualHeight #3301

Merged
merged 2 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/eds-data-grid-react/src/EdsDataGrid.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ export const Virtualization: StoryFn<EdsDataGridProps<Photo>> = (args) => {
Virtualization.args = {
stickyHeader: true,
enableVirtual: true,
virtualHeight: 500,
height: 500,
}

export const ExpandRows: StoryFn<EdsDataGridProps<PostComment>> = (args) => {
Expand Down Expand Up @@ -423,7 +423,7 @@ export const ExpandRows: StoryFn<EdsDataGridProps<PostComment>> = (args) => {
ExpandRows.args = {
stickyHeader: true,
enableVirtual: true,
virtualHeight: 500,
height: 500,
}

export const Styling: StoryFn<EdsDataGridProps<Photo>> = (args) => {
Expand Down
8 changes: 8 additions & 0 deletions packages/eds-data-grid-react/src/EdsDataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ export function EdsDataGrid<T>({
pageSize: pageSize ?? 25,
})

useEffect(() => {
if (virtualHeight) {
console.warn(
`virtualHeight prop is deprecated and will be removed in a later version. Please update your code to use height instead.`,
)
}
}, [virtualHeight])

useEffect(() => {
setVisible(columnVisibility ?? {})
}, [columnVisibility, setVisible])
Expand Down
1 change: 1 addition & 0 deletions packages/eds-data-grid-react/src/EdsDataGridProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ type VirtualProps = {
enableVirtual?: boolean
/**
* The height of the virtualized table in pixels.
* @deprecated Use `height` prop over virtualHeight, this will be removed in a later version
* @default 500
*/
virtualHeight?: number
Expand Down
Loading