fix: add Layers to the dropdown
This commit is contained in:
parent
b95ff2001e
commit
4ac85a7fd9
|
|
@ -4,6 +4,7 @@ import Select from "react-select";
|
|||
import { WrappedFieldInputProps } from "redux-form";
|
||||
import { theme } from "constants/DefaultTheme";
|
||||
import { SelectComponentsConfig } from "react-select/src/components";
|
||||
import { LayersContext } from "../../../constants/Layers";
|
||||
|
||||
export type DropdownProps = {
|
||||
options: Array<{
|
||||
|
|
@ -50,15 +51,19 @@ const selectStyles = {
|
|||
padding: "5px",
|
||||
}),
|
||||
indicatorSeparator: () => ({}),
|
||||
menuPortal: (styles: any) => ({ ...styles, zIndex: 1000 }),
|
||||
};
|
||||
|
||||
export function BaseDropdown(props: DropdownProps) {
|
||||
const layer = React.useContext(LayersContext);
|
||||
const { customSelectStyles, input } = props;
|
||||
const menuPortalStyle = {
|
||||
menuPortal: (styles: any) => ({ ...styles, zIndex: layer.max }),
|
||||
};
|
||||
|
||||
return (
|
||||
<Select
|
||||
menuPortalTarget={document.body}
|
||||
styles={{ ...selectStyles, ...customSelectStyles }}
|
||||
styles={{ ...selectStyles, ...customSelectStyles, ...menuPortalStyle }}
|
||||
{...input}
|
||||
isDisabled={props.isDisabled}
|
||||
isSearchable={props.isSearchable}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user