Code Monkey home page Code Monkey logo

Comments (4)

cherniavskii avatar cherniavskii commented on June 24, 2024 1

Hi @T-Grave
I'm not 100% sure the DataGrid should inherit the parent's height as you expected.
I forked your sandbox and replaced the data grid with 2 divs instead to see how would regular HTML elements behave in this situation: https://codesandbox.io/s/mui-x-issue-template-forked-kxxvw3?file=/src/App.tsx
The behavior seems to be identical to the current behavior of the data grid.

I prefer to keep this behavior unless there's a strong argument to do otherwise.
What do you think?

from mui-x.

yaredtsy avatar yaredtsy commented on June 24, 2024

hey @T-Grave

You can achieve this behavior by adding this.

[`& .MuiDataGrid-virtualScroller`]: {
   flex: "1 1 0px",
  overflow: "auto"
}

demo: https://codesandbox.io/s/mui-x-issue-template-forked-m5hlqs

from mui-x.

DanailH avatar DanailH commented on June 24, 2024

Thank you @yaredtsy the workaround seems to be working as expected. Either way, we need to see what caused the degradation in functionality.

from mui-x.

yaredtsy avatar yaredtsy commented on June 24, 2024

hey @DanailH

This issue was caused by #8091. When GridAutoSizer was removed, the component responsible for handling resize based on flex was also removed with it. we can fix it like this.

--- a/packages/grid/x-data-grid/src/components/virtualization/GridVirtualScroller.tsx
+++ b/packages/grid/x-data-grid/src/components/virtualization/GridVirtualScroller.tsx
@@ -25,6 +25,8 @@ const VirtualScrollerRoot = styled('div', {
 })<{ ownerState: OwnerState }>({
   overflow: 'auto',
   height: '100%',
+  flex: '1 1 0',
   // See https://github.com/mui/mui-x/issues/4360
   position: 'relative',
   '@media print': {

demo : https://codesandbox.io/s/mui-x-issue-template-forked-rn9zfz?file=/src/App.tsx

from mui-x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.