Material UI drop down select position placement

Having an issue with the dropdown position when using select from material UI. It's not appearing in the correct location.

Desired Dropdown Position:

Current Dropdown Position:

when opening the dropdown

The dropdown is displaying in the center of its field instead of below it as expected. I have researched and found that the default setting should position the dropdown below its field, but this is not happening in my case.

Code for the dropdown:

 <div className="row-5" style={{ marginTop: "21px" }}>
                            <div className="repeat">

                                <FormControl variant="standard" sx={{ m: 1, minWidth: 120 }}>
                                    <InputLabel id="repeat-id">Repeat</InputLabel>
                                    <Select
                                        style={{ width: '420px' }}
                                        labelId="repeat-id"
                                        id="demo-simple-select-standard"
                                        // value={age}
                                        // onChange={handleChange}
                                        label="Repeat"
                                        defaultValue="Never"
                                    >
                                        <MenuItem value="Never">
                                            Never
                                        </MenuItem>
                                        <MenuItem value={10}>Ten</MenuItem>
                                        <MenuItem value={20}>Twenty</MenuItem>
                                        <MenuItem value={30}>Thirty</MenuItem>
                                    </Select>
                                </FormControl>

                            </div>
                        </div>

Answer ā„–1

To correctly utilize the Select component, make sure to import it from this source:

    import FormControl from '@mui/material/FormControl';
    import Select from '@mui/material/Select';

This method has proven to be highly effective in my own experience.

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

Is there a method to globally pass retrieved server-side data to client components in a Next.js version greater than 13 app directory?

My goal is to retrieve translation JSON files from an API for my Next.js application, which is structured using the /app directory. The server-side implementation works smoothly as I can utilize the await keyword to make the API call and share the data glo ...

Words not within the span, away from the span border

Iā€™m currently in the process of creating a dedicated section on my website called "Voices of the Nation,ā€ which draws inspiration from the foundations laid out in the U.S. Constitution. The objective is to highlight individuals who have shown their sup ...

What is the best way to convert a JavaScript datetime object for comparison with the current time?

I am facing an issue with comparing these two data types. When I try to compare hive.inspection_date, which returns in the format "2022-06-10", with DateTwo, it's not matching as expected. My console.log is showing (Tue May 31 2022 17:06:57 GMT-0400 ( ...

Focusing on a specific image using Jquery

I am looking to specifically target the image within the "hero1project3" class, however, the image is currently set as a background. Is there a way in jQuery to apply effects like blur only to the image itself, for example, using ".hero1project3 img"? HTM ...

Personalized Bootstrap 4.1 Toggle Animation

I have been attempting to implement a customized menu toggle on Bootstrap 4.0's Navbar menu, using the code provided by Codeply HERE. My goal is to apply the X toggle style to my website's bootstrap navbar. Below is the current setup I have imple ...

Production build encountering unhandled TypeError in proxy

One day, I decided to tweak MUI's styled function a bit, so I came up with this proxy code: import * as muiSystem from '@mui/system'; type CreateMUIStyled = typeof muiSystem.styled; type MUIStyledParams = Parameters<CreateMUIStyled>; ...

Consistent sizing for Bootstrap thumbnail images

In my current project, I am implementing a Bootstrap thumbnail feature where each thumbnail consists of an image and a heading. However, a problem arose as the images do not have the same size, resulting in thumbnails with varying dimensions. To resolve th ...

Jenkins is unable to locate the module, '@babel/plugin-proposal-private-property-in-object' (0:undefined) for React

An Error in Jenkins identified within the console.log terminal 13:29:56 A Syntax error has occurred: [BABEL] /var/jenkins_home/workspace/govt-finance/qa/build-and-deploy-web/node-app/src/index.js: Unable to locate module '@babel/plugin-proposal-priva ...

Utilize PHP to generate a table from data

I successfully created a table using information retrieved from my database, and everything is displaying as intended. However, I am facing an issue where adding a background color applies it to every row in the table. How can I add a background color wit ...

Conceal the .dropdown-backdrop from bootstrap using solely CSS styling techniques

Is there a way to hide the .dropdown-backdrop element from Bootstrap for a specific dropdown on a webpage using only CSS? I found a solution that involves Javascript, you can view it on JSFiddle here. However, I am hoping to achieve this without relying o ...

The state is being set back to zero each time the component is rendered

Utilizing the Unsplash API, I am displaying photos and maintaining the index of each photo for use in a lightbox. However, after the initial rendering state where imageIndex resets to 0, how can I preserve its value? Here is some relevant code: const I ...

I created a design for a subscription form that appears aesthetically pleasing in Firefox, however, it does not maintain the same appearance in Opera. Any suggestions on how I can resolve this issue?

Why does my code display differently in Firefox compared to Opera? In Firefox, the height of input/text and input/submit elements are similar. However, in Opera, the height of the input/submit is reduced. This is the HTML code: < ...

Dealing with CSS specificity issues when incorporating material-ui for React into a WordPress plugin

Struggling to integrate material-ui for react in a wordpress plugin due to conflict with wordpress's styling in forms.css file. Looking for a solution that doesn't require complete restyling of material-ui components to override the default style ...

Pause the React rendering process to initiate a redirection

Currently, I am developing a React application using Next.js and facing a specific challenge that requires a solution: There are certain pages in my application that should only be accessible once a particular context has been established. To achieve this ...

When attempting to upload an API object, the error message '"'Image' object is not callable"' is displayed

Update 2, 13th Jan: Following a thorough bug search and attempting to post the object directly in the root API using json, I've concluded that the issue causing the posting error is related to the image. I utilized the HTML form to post an object, re ...

What could be the reason for the malfunction of jQuery's show() function?

Using jQuery, I have implemented a functionality to hide a div using the hide() method. However, upon clicking a link, the div is supposed to show but unexpectedly disappears after appearing briefly. HTML Code Snippet <div id="introContent"> & ...

Why am I encountering a warning about dangerouslySetInnerHTML and receiving empty content in Next.js?

First and foremost, I am aware that nesting <p> tags is not recommended. I have developed a Next.js application wherein one of my components sets rich text HTML in the following manner: <Typography dangerouslySetInnerHTML={{ __ ...

I am looking to create a feature for my table that adjusts its color scheme based on whether the number is odd or even

My current code is designed to change the background color of td elements for odd and even rows. However, when a new high score is entered, a new td is added but it does not get colored automatically as intended. I am facing an issue where the code is not ...

Jest came across a surprising token that it wasn't expecting while working with React and TypeScript in conjunction with Jest and React-testing-L

An unexpected token was encountered by Jest while using React and TypeScript along with Jest and React-testing-Library. Error occurred at: E:\Git\node_modules@mui\x-date-pickers\internals\demo\index.js:1 ({"Object." ...

Issue in ReactJs: Unable to update state due to ERR_CONNECTION_REFUSED error in fetch catch block

I'm attempting to dynamically set the error within the catch block, specifically targeting ERR_CONNECTION_REFUSED, since my localhost:8080 is intentionally not running on purpose. const [error, setError] = React.useState(""); async function login(ema ...