What could be causing my Material UI Table to disappear when I toggle the "Show" option?

I am incorporating the Grow material ui component to display or hide a table. Initially, the table is visible. https://i.sstatic.net/0OxPQ.png

  <Box className={classes.object_controls_wrapper}>
    <Box sx={{ display: "flex" }}>
      <Grow in={objectViewOpened}>{object_controls_view}</Grow>
    </Box>
    <FormControlLabel
        control={
          <Switch
              checked={objectViewOpened}
              onChange={handleToggleObjectViewOpened}
          />
        }
        label="Show"
    />
  </Box>

However, once I toggle the show button, the table gets hidden behind the map.

https://i.sstatic.net/6r3M0.jpg

The parent div still maintains a high z-index level. https://i.sstatic.net/ZNf3E.jpg

When I utilize the icon from the material UI example, its visibility toggles correctly without getting hidden in this manner.

Any recommendations on how to identify the CSS attribute causing it to be concealed?


CODE SANDBOX LINKS

As advised, this is my codesandbox link with the triangle and show toggle in the upper-right corner working as expected.

Here is the version with material-table where it doesn't function properly.


FURTHER INPUT

Upon further experimentation, it seems the issue lies within the style wrapping the hidden div. In the following demonstration, it's evident that the div is still undergoing a "transition". Upon removing that style using developer tools, my component becomes visible. This transition style commences with an opacity of 0. Could this be due to my improper use of the Grow component or is it an actual bug in material ui?

https://i.sstatic.net/kgtn3.png

The additional snippet below does not seem to eliminate the style:

<Grow
            in={objectViewOpened}
            style={{ transformOrigin: "0 0 0" }}
            {...(objectViewOpened ? { timeout: 1000 } : {})}
          >
            {object_controls_view}
          </Grow>

This code is directly from their documentation (the syntax isn't fully understood by me):

https://i.sstatic.net/8EflF.png

Answer №1

Perhaps adjusting the z-index of the map or table could help, consider trying a value of 100. Additionally, experiment with the position:relative property. Ensure that any table set to position:absolute has a parent element with position:relative. Although the body usually defaults to position:relative, there are instances where you may need to explicitly declare it.

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

Which is better for website footers: tables or nested ULs?

I am trying to create a footer with a specific layout that consists of item titles and images. The design I have in mind includes three columns, where the middle one is larger than the sides. The middle column should be 550px wide, while the side columns s ...

What is the proper way to incorporate html entities in my specific situation?

In my application, I am attempting to incorporate double macron characters. My current method involves using the &#862; entity, like this: t&#862;t, which results in t͞t. However, I have encountered issues with reliability, as sometimes the ...

The height of the image remains constant when its width is decreased, causing it not to resize proportionally

I am facing an issue with displaying images in a div of various resolutions. When I have a wide image with low height, such as 730x90, it does not show properly on mobile devices. The width shrinks but the height remains the same. Below is the code snipp ...

What can I do to resolve the problem with td border

Check out my website over at browsethewebclean.com I've come across a peculiar issue with the borders and background color of some nested tables on my page. It seems that the border is not aligning properly and the background color goes beyond the im ...

"click on the delete button and then hit the addButton

I have created a website where users can save and delete work hours. I am facing an issue where I can save the hours at the beginning, but once I delete them, I cannot save anything anymore. Additionally, when I reload the page, the deleted data reappears. ...

Ensure that the dropdown <select> remains open even while filtering through options

I am currently working on implementing a mobile-friendly "filtered dropdown" design: Usually, a <select> control remains closed until the user clicks to open it. Is there a straightforward way to keep it always open? I understand that this would ma ...

Struggling to properly close the bootstrap tags

Having an issue where I can't seem to properly close Bootstrap tags in my code. Here's a snippet of the HTML: <html> <head> <link href="css/bootstrap.min.css" rel="stylesheet"> <script src="js/jquery.js ...

Error message: "react-router typescript navigation version 0.13.3 - Unable to access 'router' property"

I'm currently in the process of porting an existing React project to TypeScript. Everything seems to be going smoothly, except for the Navigation mixin for react-router (version 0.13.3). I keep encountering an error message that says "Cannot read prop ...

Ways to conceal a text-filled div behind an image using 3D transformation

I've been working on creating three images with a fun 'flipcard' effect for the past day and a half, and I believe I'm getting closer to achieving my goal. However, there is one issue remaining, as you can see in the codepen. When the ...

What is the best way to store settings values permanently during the installation process in a react-native application?

I am looking for a way to save the settings of my app only during installation, rather than every time the app is opened, in order to prevent the options from resetting. I have tried searching on YouTube but most tutorials cover only user login persistence ...

Can the autoscroll offset be adjusted while dragging?

I am developing a single-page application using Vue.js. The user interface consists of three main components: A fixed navbar at the top with a z-index of 2 A fixed sidebar on the left with a z-index of 1, and padding to accommodate the navbar A central ar ...

Python Selenium for Element Detection

I am a beginner when it comes to using Selenium and I am currently seeking guidance on how to locate the element that is highlighted in this image: Despite my attempts, the following code resulted in an error message being displayed: create_a_detector_b ...

Can you have two navigation bars and a picture all in one Bootstrap layout?

I have a requirement to use a single image on two different Bootstrap navbars. However, the issue is that the image appears split between the two navbars.https://i.stack.imgur.com/jUnIL.png My goal is to display the full image without it being divided bet ...

You can eliminate the display flex property from the MuiCollapse-wrapper

Having trouble removing the display flex property from the MuiCollapse-wrapper, I did some research and found the rule name for the wrapper in this link https://material-ui.com/api/collapse/ I have been unsuccessful in overwriting the class name wrapper t ...

Excessive white space at the bottom of a floated image within a small parent element

I need help with styling a page that will only be viewed on mobile Safari. The HTML markup is as follows: <blockquote> <p><img src="..."/> A paragraph...</p> <p>...</p> ... </blockquote> Here is the CSS u ...

Styling Radio Buttons and Links in Horizontal Layout Using Bootstrap

Encountering an issue in Bootstrap while attempting to incorporate custom radio buttons and a hyperlink in the same row. It seems that either the hyperlink functions OR the data-toggle feature for radio buttons works, but not both simultaneously, especiall ...

Struggling with properly configuring and deploying create-react-app with NPM?

I've been exploring the Node ecosystem and attempting to establish continuous deployment for my application on AWS Amplify. My project structure is as follows: project public index.html src App.tsx/App.js package.json This structure wa ...

Linting: Add "`··` eslint(prettier/prettier)" to a project using React with TypeScript and Styled Components

I'm facing a challenge with conflicting rules between Eslint and Prettier in my React project that uses TypeScript and Styled Components. When working in VSCode, I keep getting this error message: "Insert ·· eslint(prettier/prettier)" T ...

Creating a container that scrolls horizontally

I am working with ngbootstrap and angular, however, I believe the issue at hand is more related to html/css. My goal is to create a container that scrolls horizontally, despite coming across several helpful threads on this topic, I am struggling to impleme ...

Using React to sort and retrieve only the duplicate values in an array

Within this Array, I am retrieving all the idCategory values of "answersTo", some of which are duplicates. I'm trying to filter out only those duplicates, but it's not a straightforward comparison since there is no specific data to compare agains ...