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:

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

Tips for obtaining the XPath for an unordered list and a span element

My goal is to find the xpath that will select the seat "12A" from a webpage containing a list of seats. Here's the source code: <div class="seats" style="top: 48px;"> <ul class="row_12 leftOfAisle"> <li><a class="" data-r ...

How can you apply a class to a different element by hovering over one element?

Is there a way to darken the rest of the page when a user hovers over the menu bar on my website? I've been playing around with jQuery but can't seem to get it right. Any suggestions? I'm looking to add a class '.darken' to #conte ...

When an input field is added to an HTML form, all elements positioned below it automatically inherit its attributes

I have a unique combination of HTML and CSS code that creates an impressive login form: <!DOCTYPE html> <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <title>Prepare to be amazed...</title> <l ...

Custom background options for Wordpress developer

I have been exploring the WordPress codex to learn about incorporating custom background options, similar to this example $defaults = array( 'default-color' => '', 'default-image' => '&apo ...

A blank page appears when deploying a React app on GitHub pages

As a beginner with react, I recently completed building my first application. Now, I am facing an issue while trying to deploy it on Github Pages – the page appears completely blank. Here are the steps I have taken so far: Installed gh-pages using: npm ...

Replace the css variables provided by the Angular library with custom ones

Having an angular library with a defined set of css variables for colors applied to components, which are globally set like this: :root { -color-1: #000000; -color-2: #ffffff; ... } In my application utilizing this library, I need to override ...

What folder structure works best for organizing a React frontend project?

As of late, I've become intrigued by React as I believe it has the potential to open up job opportunities for me in the near future. While I'm already well-versed in Laravel PHP, it seems that alone may not be enough when it comes to job hunting. ...

Within my React project, I have incorporated a popover component from Material UI. However, I have encountered an issue where the popover does not appear when hovering over the icon

I'm struggling with a certain issue. I have created a popover component that should display when the user hovers over an 'i' icon and disappear when they move away from it. However, it seems like the open and close methods are being continuo ...

How can I integrate a timer into an Angular carousel feature?

I have put together a carousel based on a tutorial I found on a website. Check out the HTML code for my carousel below: <div class="row carousel" (mouseover)="mouseCheck()"> <!-- For the prev control button ...

The outcome of the JQuery function did not meet the anticipated result

Here is the code I am using: $("p").css("background-color", "yellow"); alert( $("p").css("background-color")); The alert is showing undefined instead of the expected color value. I have tested this code on both Google Chrome and Firefox. Strangely, it w ...

React: Modifying state based on information received from a child component

One dilemma I'm facing involves a child component on my page that contains an input. The goal is to extract the value entered into this input box and use it to update the parent's state. In essence, when a user types in a name and presses enter, ...

Starting the Android System Magnifier with a Click: A Step-by-Step Guide

Is there a way to incorporate a magnifying glass into an HTML page using jQuery or within an Android app? Ideally, it would be for a single picture. In my application, I am displaying an HTML file from my assets in a webview. The HTML page utilizes jQuery ...

Listening for position changes using jQuery events

It is essential to be able to track the relative position of elements, especially when dealing with dynamic layout issues. Unfortunately, there are no built-in options in CSS to listen for changes in position() or offset() attributes. Reason: Changes in a ...

Having trouble with the onLoadingComplete props in the Next.js Image component?

Is there a way to properly retrieve the naturalWidth and naturalHeight using the onLoadingComplete props? I tried following the documentation on https://nextjs.org/docs/api-reference/next/image#onloadingcomplete but it doesn't seem to be working. Am I ...

The confirm() function shows up before the background on a blank layout

I'm facing an issue where whenever my confirm() function pops up, the alert box displays correctly but then the background turns blank. I've tried various solutions like moving the entire if statement to the bottom of the page or at the end of th ...

Stop any additional subscriptions if the current one has not yet been completed using Redux-Observable

I'm currently working on an exciting action that retrieves company data from a local server. This action is triggered in the componentDidMount method of a React component. Upon receiving the data, I create models and send them to the reducer to be pro ...

Learn how to utilize AngularJS Material to toggle the enable/disable functionality of a checkbox

Can someone assist me in enabling and disabling the checkbox as shown in the attachment image https://i.stack.imgur.com/l6g1C.jpg View the PLNKR angular.module('BlankApp', ['ngMaterial']) .config(['$mdThemingProvider', fun ...

Getting a single item from nested objects within arrays

Having retrieved data from an open API, I encountered an issue when trying to display an image in my browser. The Images array contains 3 image URLs, and despite using the map method on arrays, calling the first object [0] did not yield the desired result. ...

What could be causing my dropdown menu to not appear when clicked?

I am trying to implement the functionality shown in the image. When the Settings button is clicked, a window should open allowing the user to navigate to their desired option. However, I am facing an issue where nothing happens when the button is clicked. ...

Turning off the ability to horizontally scroll in an iframe using touch controls

I am trying to disable horizontal scrolling in an iframe on my website, particularly when a user uses touch input and drags horizontally. The scroll bars can still be visible and draggable when touched directly. Unfortunately, I do not have control over th ...