Using Material UI's DropDownMenu to achieve full height coverage

On a specific page, I have a DropDownMenu embedded inside a table column.

Whenever I try to open the menu, it expands to 100% of the page height.

I couldn't find any information regarding this issue in the documentation or community forums.

The child components do not have any relative/absolute container relationship.

Even setting maxHeight did not resolve the problem.

Thank you in advance for any assistance provided.

EDIT:

Here is some code to better illustrate the situation:

This component initializes the DropDownMenu:

export default ({
  variables,
}: Props) => (
  <Table multiSelectable>
    <TableHeader enableSelectAll>
      <TableRow>
        <TableHeaderColumn className={styles.headerColumn}>Variable</TableHeaderColumn>
        <TableHeaderColumn className={styles.headerColumn}>Type</TableHeaderColumn>
        <TableHeaderColumn className={styles.headerColumn}>Line 01</TableHeaderColumn>
        <TableHeaderColumn className={styles.headerColumn}>Line 02</TableHeaderColumn>
        <TableHeaderColumn className={styles.headerColumn}>Line 03</TableHeaderColumn>
      </TableRow>
    </TableHeader>
    <TableBody>
      {variables.map(variable => (
        <TableRow key={variable.id}>
          <TableRowColumn className={styles.column}>{variable.header}</TableRowColumn>
          <TableRowColumn className={styles.columnDropdown}>
            <DropDownMenu value={variable.type}>
              <MenuItem value="numerical" primaryText="Numerical" />
              <MenuItem value="categorical" primaryText="Categorical" />
              <MenuItem value="key" primaryText="Key" />
              <MenuItem value="answer" primaryText="Response" />
            </DropDownMenu>
          </TableRowColumn>
          {variable.line.map(line => (
            <TableRowColumn key={line} className={styles.column}>{line}</TableRowColumn>
          ))}
        </TableRow>
      ))}
    </TableBody>
  </Table>
);

Below is the SASS module used in the code:

.headerColumn {
  font-size: 16px !important;
}

.column {
  font-size: 14px !important;
}

.columnDropdown {
  @extend .column;
  padding-left: 0 !important;
}

There are no floats or absolute positioning in this component. Upon inspection, the open Menu seems to have attributes like top: 0 and max-height: 1014px;, although the reason behind this behavior remains unclear.

Answer №1

[data-reactroot] {
  max-height: 100% !important;
}

It ended up causing issues.

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

Efficiently align a Modal in React without the need to rewrite any code

In my application, I have a class called InventoryView that is responsible for displaying a list of stock items. The class is structured as follows: class InventoryView extends Component { ... render() { ... { consumableItemsArray.map((ro ...

What is the variance in performance between the sx prop and the makeStyles function in Material UI?

I recently started delving into Material UI and learned that it employs a CSS in JS approach to style its components. I came across 2 methods in the documentation for creating styles: First, using the sx prop: <Box sx={{ backgroundColor: 'green& ...

Can a 1D array be utilized to create a 2D grid in React?

I needed to display a one-dimensional array in a 2D grid format with 3 rows and 3 columns. The array itself contains numbers from 1 to 9. const array = Array.from({ length: 9 }, (_, i) => i + 1); In my React component, I have it rendering as a series o ...

React JS project experiencing issues with Material UI components not functioning properly

Here is a unique version of my app.js code: import React from "react"; import './App.css'; import {Button} from "@mui/material"; function App() { return ( <div className="App"> <h1>COVID-19 T ...

Increased/Decreased impact

Can someone explain how the "Tell me more" effect is achieved on the website linked below? I'm familiar with the read more/less effect in jQuery, but what intrigues me is that the page cannot be scrolled unless the button is clicked. Here is the link ...

Customizable trapezoid in SVG format with adjustable points relative to one another and the option to add gradients

I have explored numerous options while searching for a way to create a responsive, full-width trapezoid with a gradient but have come up short. Using SVG, I was able to get close to the desired shape, but encountered problems when the trapezoid's dime ...

When attempting to change the text in the textarea by selecting a different option from the dropdown list, the text is not updating

I am facing an issue with three multi-select dropdown lists. When a user selects options from these lists and then presses the submit button, the selected text should display in a textarea. However, if the user manually changes some text in the textarea ...

Developing applications using React.js involving parent and child components

I am currently working with a setup of 3 components - 2 child components and one parent component. My goal is to pass the values from the child components to the parent component without displaying the entire components in the parent, and then passing thes ...

Discovering the positions of HTML elements rendered with WebKit (or Gecko) technology

I am seeking a way to retrieve the dimensions (coordinates) of all HTML elements on a webpage as they appear in a browser, including their rendered positions. Specifically, I need to obtain values like (top-left, top-right, bottom-left, bottom-right) Afte ...

The flexbox layout is not properly stacking div rows in a column

Objective: Creating a flexbox layout with a responsive background image that adjusts in height when the screen size changes, causing elements to wrap; In addition, there is a fixed header bar at the top of the page. The layout consists of a full-screen co ...

The row containing a list of inline elements cannot be cleared in Safari due to the ineffectiveness of the

I have encountered an issue with my list formatting that seems to work in Chrome and Firefox but not in Safari. The pseudo attribute is not taking effect in Safari and I am wondering if there is a workaround or a different approach that I should take. (Not ...

How can elements be displayed differently depending on the return value of a function?

Basically, I am looking to display different content based on the status of a job: Show 'Something1' when the job is not processing Show 'Something2' when the job is running and has a status of '0' Show 'Something3&apos ...

The process of React life cycle in functional components

I am new to react.js and struggling to grasp class components. The React lifecycle is something I am working hard to understand. ...

Picture not displaying properly in alternative browsers

While working on a simple website using html and css, I encountered an issue where my logo was not displaying for users on different browsers. Here is the image description Below is the HTML code: <section id="header"> <div class=& ...

Encountering a surprise token error when using a material-ui example

I've been working on a reactjs web app using react-slingshot as the starting point. Everything was going smoothly until I decided to incorporate material-ui with `npm'. After adding an appbar and some buttons, the layout looked great. Then, I at ...

Ensuring complete height and width with no scrollbar in a Material UI React application

I'm attempting to create a page that fills the entire height of the screen without adding an undesirable scrollbar. When I say 100% height, I mean it should just fit the size of the screen. Here is a demonstration of the issue. The yellow highlighted ...

Improving the functionality of the search box

I'm currently working on a map project using the google-maps-react API within React. I've encountered an issue where typing characters in the search box doesn't filter my list or markers. Any suggestions on how to tackle this problem? Below ...

Mastering data extraction from JSON using React JS (with Axios)

Being new to ReactJS and axios, I am facing a challenge. I need to iterate through JSON data and extract values where the key is a number (e.g. 0, 1, 2...). However, I am unsure how to implement this in my code since the server provides dynamic JSON data ...

Creating an expand and collapse animation in a `flex` accordion can be achieved even when the container size is fixed using

Good day, I am in need of a fixed-height HTML/CSS/JS accordion. The requirement is for the accordion container's height to be fixed (100% body height) and for any panel content overflow, the scrollbar should appear inside the panel's content div ...

Issue with the alignment of DIV container due to spacing issues

In the screenshot below, there is a DIV container with padding of 15px on the left and right. However, the contents are appearing spaced out downwards for some reason... Other than the left & right padding, no other styling seems to be affecting it. Adjus ...