Issue with MUI data grid not resizing properly within a grid container: The dimensions of the MUI data grid are not adjusting as anticipated

In my setup, I have a main grid <div> container that contains two child elements. One is the MUI <DataGrid />, and the other is a simple <div>:

Here's how it looks in JSX (React):

<div className="container">
  <DataGrid
    rows={someRows}
    columns={someColumns}
  />
  <div className="somethingElse">
    ...
  </div>
</div>

The CSS for the layout is as follows:

.container {
  display: grid;
  width: 100%;
  grid-template-columns: 3fr 1fr;
}

My expectation is:

  1. The <DataGrid /> and
    <div className="somethingElse">
    should be next to each other, with the <DataGrid /> taking up 3/4 of the total window width, and
    <div className="somethingElse">
    taking up 1/4.
  2. When the user resizes the window, the 3/4 and 1/4 split should remain constant, but both elements should expand or shrink accordingly.

However, in reality: The size of the <DataGrid /> does not change when resizing the window.

I'm wondering if there are any specific styling adjustments needed for the correct behavior of the grid.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the proper way to showcase thumbnails in different sizes?

Currently, this is what I have: The display looks optimal with high-resolution landscape photos. This is the HTML and CSS code in use: <div class="upload-thumb ng-scope visible"> <span class="delete-media"> <span class="icon-bin ...

Preventing page reload in Supabase with NextJS when the website loses focus and regains it

I am working with the structure in _app.js of my Next.js app. // _app.js // import ... import { createBrowserSupabaseClient } from '@supabase/auth-helpers-nextjs' import { SessionContextProvider } from '@supabase/auth-helpers-react' // ...

Tips for accessing jQuery UI tab elements and adjusting visibility for specific panels

How can I retrieve the panel numbers of jQuery UI tabs and adjust their visibility using CSS? I am looking to identify the panel numbers of each tab and control the visibility of certain tabs. <div id="tabs"> <ul> <li><a href="#"> ...

Tips for positioning the overlay to match the icon list when hovering- JavaScript/Cascading Style Sheets (CSS)

My challenge involves a list of <li>'s accompanied by an icon that, when hovered over, displays an overlay containing information about the 'test'. The setup looks something like this: test1 test2 test3 and so forth.... Here' ...

How can I make the sort icon in a Material UI Datagrid column always visible?

Check out this codesandbox link. I'm currently working on enabling sorting by first name and last name in the default Datagrid. However, the sort icon only appears when hovering over it. Is there a method to make it always visible? Appreciate any assi ...

Gatsby MDX fails to locate the desired page despite displaying the title and slug

Currently diving into the world of Gatsby and I've decided to implement MDX for my blog pages. Following a helpful tutorial here on programmatically creating pages. All seems well as I can view them in my GraphQL and displaying the list of articles i ...

I sought out a way to incorporate a hyperlink within the Material Data Grid

Take a look at this sample data grid for reference: here. I added an image like this: see here. However, I couldn't create a clickable link. ...

Setting a fixed width for the body element results in alignment problems

I'm struggling with aligning divs properly on my HTML page that has a tab using CSS and jQuery. Whenever I try to set a fixed width for the body or main container, everything goes out of place... How can I ensure that the body has a minimum fixed widt ...

React - verifying properties

Here's a question that I've been pondering. In many situations, we find ourselves needing to check if props are undefined. But what about nested props? For example, let's say we have: this.props.data.income.data1.value.chartData and we wa ...

Guide to incorporating PieChart along with its inputText in #ReactNative

I've been struggling to achieve the desired output using various methods. Can someone please provide detailed code assistance? Click here for image description I've been struggling to achieve the desired output using various methods. Can someone ...

Encountering an "unexpected token" error while utilizing the JSOP API in a ReactJS application

I am facing an issue while fetching data from a JSON API, as it is throwing an "Unexpected token" error. Below is the code that I have tried so far. Any help in resolving this problem would be greatly appreciated. Below is the code snippet: var Demo = Re ...

Encountering issues with dependencies while updating React results in deployment failure for the React app

Ever since upgrading React to version 18, I've been encountering deployment issues. Despite following the documentation and scouring forums for solutions, I keep running into roadblocks with no success. The errors displayed are as follows: $ npm i np ...

Looking to add elements to a specific div dynamically using jQuery? Let's explore how to insert comments seamlessly

I would like to implement a comment system that adds entered comments to a specific div. Here's the code I have so far: <ul class="comments"> <li> <a class="commenter_name" href="/">Dushyanth Lion</a> ...

The transition in Material-UI Swipeable Drawer is a bit choppy and not as

import { ThemeProvider } from '@material-ui/core/styles' import React, { useState } from 'react' import { Link } from 'react-router-dom' import AppBar from '@material-ui/core/AppBar' import Toolbar from '@mate ...

What could be causing my form to not be centered on the screen?

Currently working on creating a form for adding books to a fictional library website. The form tag is enclosed within a div, but despite the CSS styling applied, it remains fixed to the left side of the screen and I'm struggling to understand why. .fo ...

Scaling Vuetify icons dimensions

During the development of an app using Vuetify, I encountered challenges in changing the default colors set by Vuetify. After some trial and error, I came across a solution on: https://github.com/vuetifyjs/vuetify/issues/299 The solution involved adding ...

Navigating Next.js routes while utilizing React-Redux state management requires some careful integration of routing

Within my application, I have an authState variable which is a boolean indicating whether the user is logged in or not. This information is crucial for the functionality of my main layout component, which is shared across all components. Inside this layout ...

Invoking a function in a React component from another component

I am trying to implement a page with the structure shown below: const Upload = (props) => { return ( <BaseLayout> <ToolbarSelection /> <Box> <FileDropArea /> </ ...

Tips for changing the background color depending on the value

I am creating a table displaying the results of a tournament. Each team's final placement and original seeding will be listed. I plan to include a small bubble next to each team showing how their final placement compares to their initial seeding. To v ...

A guide on utilizing axios to retrieve JSON data in a React app while using a proxy

I recently developed a next.js app and encountered an issue with one of its pages. Here is the code snippet from the page: ../pages/index.js 1 │ import axios from 'axios'; 2 │ 3 │ const Page = ({ data }) => { 4 │ ...