When using your MuiPhoneNumber
component, keep in mind that it makes use of a MUI modal for country selection with a default z-index
of 1300
. Unfortunately, there doesn't seem to be a prop available to customize its CSS properties directly. However, you can still apply your preferred styling solutions by targeting the #country-menu
(the modal's ID) like this:
<div>
<style type="text/css">
{`
#country-menu {
z-index: 1801;
}
`}
</style>
<DialogContent style={{ width: 300, height: 500 }}>
<MuiPhoneNumber
name="MobileNo"
label="Mobile No."
variant="outlined"
fullWidth
defaultCountry={"vn"}
value={selectedValue}
onChange={(e) => setSelectedValue(e)}
/>
</DialogContent>
</div>
https://codesandbox.io/s/nested-dialog-menuitem-dropdown-forked-68tbq?file=/dialog2.js