Create custom buttons in Material-UI to replace default buttons in a React modal window

How can I prevent overlay on material-ui's RaisedButton?

When I open a modal window, the buttons still remain visible.

Which property should be added to the buttons to disable the overlay?

Any assistance from those familiar with material-ui would be greatly appreciated.

Screen capture below: https://i.sstatic.net/ByeZb.png

I attempted using z-index for the button's container without success.

Answer №1

After applying the `z-index` and `position` properties to the button, it is now functioning correctly.

 <div className={styles.watch__button}>
          <RaisedButton
            onClick={buttonRole}
            backgroundColor={timerButtonColor}
            style={{zIndex: 0, position: 'relative'}}>
            <div className={styles.watch__button__text}>{buttonName}</div>
          </RaisedButton>
        </div>
        <div className={styles.watch__button}>
          <RaisedButton
            onClick={this.handleShowCalendar}
            backgroundColor={genButtonColor}
            style={{zIndex: 0, position: 'relative'}}>
            <div className={styles.watch__button__text}>Generate</div>
          </RaisedButton>
        </div>
        <Modal
          isOpen={showCalendar} >
          <button onClick={this.handleShowCalendar}>close</button>
          <h1>Modal Content</h1>
        </Modal >

It might be worth exploring how to achieve the same result using classes instead of inline styles, as currently it only seems to work with the latter.

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

Issue with the JQuery Lightbox 2 Plugin

I'm currently in the process of developing a gallery using jQuery Lightbox 2 (visit the plugin page here). I am encountering an issue where the navigation entries remain visible even when an image is selected (view example here). The navigation is cre ...

Error: TypeScript React SFC encountering issues with children props typing

I am currently working with a stateless functional component that is defined as follows: import { SFC } from "react"; type ProfileTabContentProps = { selected: boolean; }; const ProfileTabContent: SFC<ProfileTabContentProps> = ({ selected, child ...

As the height is expanded, the background color gradually infiltrates the body of the page

I am currently working on an angular application that utilizes angular-pdf. The controller and view function perfectly, and the PDF is displayed correctly, except for one issue. The height of the PDF exceeds the min-height of the module, causing it to expa ...

Adjusting transparency on various DIV elements

Currently, I am working on implementing the 'OnClick' functionality in jQuery. The goal is to have only the parent div and its child divs displayed when we click on the parent div property, while fading out all other divs. Below you can find the ...

The error message "Next.js 14 does not recognize res.status as a function"

I'm a newcomer to Next.js and I've been wrestling with an issue all day. Here's my API for checking in MongoDB if a user exists: import {connect} from '../../../../lib/mongodb'; import User from '../../../models/userModel&ap ...

Transferring properties from React Router to child components on the server side

For my Isomorphic app using React, react-router v3, and material-ui, it's crucial to pass the client's user agent to the theme for server-side rendering. This is necessary for MUI to properly prefix inline styles. Initially, the root component o ...

Is it possible to personalize/modify the dropdown menu text?

Is it feasible to adjust the positioning and font color of my drop-down menu text? I aim to have the "title" section in black text on the left side and the "type" section in gray text on the right side of the drop-down menu. Currently, all the text is in ...

Troubleshooting the Confirm Form Resubmission problem on my website

Hello everyone! I'm working on a website and facing an issue where refreshing the page triggers a confirm form resubmission prompt. Could someone please advise me on how to resolve this? Thank you in advance! ...

Using ReactJS to capture keydown events from an iframe

I am trying to implement keydown event handling for an iframe within a ReactJS component. The iframe contains an embedded video, and I want to be able to capture keyboard events while the video is playing. Can someone please assist me with how to achieve ...

What is the method for integrating an element into a different flow using the position property?

How can I solve the following issue: I am working with a carousel markup that has the same HTML structure as shown below. <div> // Contains the carousel slide <div> <ul> <li><img src={....} /></li> <li ...

On the second attempt to call setState within the componentDidMount method, it is not functioning as expected

As a newcomer, I am delving into the creation of a memory game. The main objective is to fetch data from an API and filter it to only include items with image links. On level one of the game, the task is to display three random images from the fetched data ...

The default value for an empty string in Material UI Autocomplete is set

When an empty string is passed to the Autocomplete component, it triggers a console warning indicating that the value is invalid. Is there a way to prevent this warning from appearing? While it doesn't cause any actual issues, seeing it in the consol ...

Tips for resolving the "ModuleNotFoundError" issue in Vercel when trying to deploy a Next.js application

Every time I attempt to deploy my website to Vercel, I am encountering this ModuleNotFoundError. Despite renaming my components and CSS modules, the error persists. If anyone has a solution to this issue, please share as I am clueless about what could be ...

Exploring Reactjs's Mouse Wheel Events

Is there a way to capture mouse wheel events in reactjs? I attempted using onWheel render: function() { return <div onWheel = {this.handleMouseWheel} > < /div>; }, and I also tried onScroll render: function() { return & ...

Formik's handleChange function is causing an error stating "TypeError: null is not an object (evaluating '_a.type')" specifically when used in conjunction with the onChange event in DateInput

When using the handleChange function from Formik with the DateInput component in "semantic-ui-calendar-react", I encountered an error upon selecting a date. https://i.stack.imgur.com/l56hP.jpg shows the console output related to the error. AddWishlistFor ...

Adding two BR tags between inline images within a wrapper is causing inconsistencies in spacing when viewed in Firefox compared to all other browsers. Check out an example of this issue in

JS Fiddle Link http://jsfiddle.net/Xfvpu/1/ Having a perplexing issue with image rendering in Firefox compared to other browsers. The xhtml doctype is used with proper br / tag spacing, but the gap between two images on this specific document displays dif ...

Effortless gliding towards the left

I am looking to incorporate buttons for smooth horizontal scrolling within my container. Currently, the functionality is in place but I would like to enhance its smoothness. How can I improve the scrolling experience? Should I consider using a different p ...

How to insert additional spacing within an input tag class in dynamic HTML using jQuery

When creating an html table dynamically from json data, I encountered an issue with adding space inside my input button control. It seems that after separating two classes with a space, the code is not functioning properly in this snippet environment. Howe ...

The application of styling to a CSS class is unsuccessful when the class is dynamically added through Angular

My goal is to create a header that moves with the page and stays fixed once it reaches the top. I am using Angular and came across a solution on Stack Overflow which suggested binding a class toggle to the window scroll event to achieve this effect by addi ...

Can you explain the process of NuxtJS css extraction for creating static websites?

I am currently working on creating a static website using my minimal code with Nuxt. This code includes integration of the tailwindcss toolkit and vue2-leaflet. When I run nuxt generate I end up with two CSS files - one for the tailwindcss styles and an ...