White border appears when hovering over MUI TextField

I've been troubleshooting this issue for what seems like an eternity. I've combed through Chrome's inspect tool, searching for any hover styles on the fieldset element, but to no avail. Here's my dilemma... I simply want a basic outlined input. A black border with blue focus. However, every time I hover over the input, a pesky white border appears. You'd think setting the hover border to transparent would do the trick, right? Nope. Whenever the input is in the active state and you hover over it, the border turns transparent... not ideal at all. I'm desperate to eliminate this hover effect entirely, but despite scouring documentation, StackOverflow, and countless Google searches, I can't seem to find a solution. How difficult can this be, really? Can anyone provide insight on how to rid the input or fieldset border of its hover effect?

Answer №1

After hours of experimentations, I have finally found a solution to my issue. It turns out that the border is actually coming from the notchedOutline element. By setting the borderWidth to 0 and the color to transparent, I was able to disable the hover effect on the input. To add a static border to the input, I simply placed a border around the input itself instead of the notched outline. Here's the code that solved the problem for me... What a relief!

MuiOutlinedInput: {
  styleOverrides: {
   input: {
    padding: "3px 3px 3px 10px",
    border: "1px solid #333333",
},
  notchedOutline: {
  borderWidth: 0,
  borderColor: "transparent",
  },
},
},

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 incorporate a randomly generated number from a variable into a JSON index retrieval?

For my project, I am working on a slideshow that pulls image URLs from a JSON file containing 100 images. However, I only want to display 5 random images from the JSON each time the page loads. The HTML is styled within a style tag in an EJS file that is l ...

Troubleshooting in Vercel: Unable to render PNG file in Next.js

While working on a project using Next.js and Sass, I encountered an issue when deploying it on Vercel. The PNG images did not render properly, whereas the SVG files displayed without any problems. Interestingly, the PNG images render fine in my localhost ...

Is there a way to modify a specific item within a useState Array in Reactjs?

Having a useState hook that stores data in the following structure: const [orderData, setOrderData] = useState({ demoData1: '', demoData2: '', demoData3: '', demoArrayData: [{itemName: '', itemNumber: ...

How to smoothly scroll with jQuery animation without relying on $.browser and preventing double firing

Many inquiries have arisen about the cross-browser functionality of $('html, body').animate();, yet I seem unable to find a solution for this particular issue: I am eager to eliminate $.browser from my code, but I do not want the scroll event to ...

What could be causing the error when attempting to send an HttpResponse from a Django View function?

Trying to utilize Ajax, I'm attempting to call a Django View function from JavaScript code. The View function is expected to return an HttpResponse, which should then be printed out on the console. However, upon inspection of the console, it simply s ...

Unable to fetch user information from MongoDB using findOne query

I am currently developing a user-friendly Walk-In registry application where I can input customer information and then efficiently retrieve that customer's details using their phone number. While I have completed the registration feature, I am facing ...

Storing uploaded files with multer in a Node.js environment using JavaScript

I am facing an issue with uploading multi part form data containing one file input and several text inputs. I have a directory named 'public' which contains a sub-directory named 'uploads'. My goal is to store all multer uploads in the ...

What makes 'onSnapshot' in Google Firebase so lightning-fast and instantly triggered?

I created a basic react application to experiment with Google Firebase. Does anyone know how the onSnapshot method functions? I find it incredibly fast, almost instantaneously updating even when I switch my network to slow 3G in the devtools. Interestingly ...

Discover the steps to develop a dynamic circular progress indicator capable of visualizing data for three distinct values utilizing Mui CircularProgress

Is it possible to display three different values simultaneously in the MUI v5 CircularProgress component? export const StatusCircle: React.FC<Props> = ({ a, b, c }) => { return ( <StyledBox> <StyledCircularProgress size={50} thicknes ...

Error: The property 'target' cannot be read

I'm seeking to enhance a value by pinpointing a specific element within a loop. <div *ngFor="let item of items; let i = index"> <ion-button (click)="increment(i)"> <ion-icon name="add"></ion ...

unable to format radio button list

Having trouble aligning the radiobutton list to the left of the label above. Here is the code snippet: <div style="border-radius: 10px;"> <div style="margin-bottom: 10px"></div> <asp:Panel ID="panel" runat="server"&g ...

Switching URLs or internal pages using jQuery Mobile's select menu feature

Utilizing a select box as the navigation menu for my jQuery Mobile website. Some menu items link to internal pages while others link to external URLs. This is the code I'm using to change the page URL: $('#menu-select').change(function() ...

Having trouble getting `npm start` or `npm install` to work in the WSL installer on Windows 10? Encountering

Attempting to work on GitHub React apps on my Windows 10 computer has been a challenge. Every time I clone the repository and try to launch it, I encounter this message: Error message At the end of the error, there is a debug link: debug.log I have sea ...

Is it acceptable to use JavaScript files in the pages directory in NEXTJS13, or is it strongly advised to only use TypeScript files in the most recent version?

In the previous iterations of nextJS, there were JavaScript files in the app directory; however, in the most recent version, TypeScript files have taken their place. Is it still possible to begin development using JavaScript? I am working on creating an a ...

Having trouble with my jQuery .hover() code not running as expected

Whenever I hover over my divs, I want them to change color. However, the code doesn't seem to be working as expected when I try to do so. I suspect that the issue might be related to the z-index property used in the class that I am trying to hover ove ...

Assigning a Value to a Dropdown Menu in Angular

I have some JSON data that contains a True/False value. Depending on whether it is true or false, I want a specific option in a Select Dropdown to be automatically selected. This is the HTML code using Angular 16: <select name="reportNo" id=& ...

What is the method for altering the state of a single element within a map?

As I delve into learning React, I encountered a persistent issue that has been absorbing my time for several hours now. The problem revolves around mapping an array of product sizes to buttons and controlling the state change of only the last clicked butto ...

Incorporating Chip into a Material-UI DataGrid column

I'm having trouble displaying data of a specific column inside a chip. I attempted to use the Chip component in my code: StackBlitz Demo Web Link: Live Demo I tried to incorporate it using: import Chip from '@mui/material/Chip'; but c ...

Tips on obtaining the screen resolution and storing it in a PHP variable

Hey there! I've run into a bit of a roadblock that I'm struggling to overcome. I know that I need to incorporate some JavaScript to solve this issue, but I'm having trouble grasping how to do so. Here's the script I'm working with: ...

What is the best way to shut down a browser using C#?

After clicking the Login button, I want to automatically close the browser if the login is successful. protected void btnLogin_Click(object sender, AuthenticateEventArgs e) { if (isAuthenticated) { // close the browser } } Since I am not using AJAX, thi ...