mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Select zindex (#22109)
This commit is contained in:
parent
6ee84cd2fc
commit
95b1607cbf
@ -1,4 +1,4 @@
|
||||
import React, { useRef } from 'react';
|
||||
import React from 'react';
|
||||
import { SelectableValue, deprecationWarning } from '@grafana/data';
|
||||
// @ts-ignore
|
||||
import { default as ReactSelect } from '@torkelo/react-select';
|
||||
@ -24,7 +24,6 @@ import { SingleValue } from './SingleValue';
|
||||
import { MultiValueContainer, MultiValueRemove } from './MultiValue';
|
||||
import { useTheme } from '../../../themes';
|
||||
import { getSelectStyles } from './getSelectStyles';
|
||||
import { RefForwardingPortal } from '../../Portal/Portal';
|
||||
|
||||
type SelectValue<T> = T | SelectableValue<T> | T[] | Array<SelectableValue<T>>;
|
||||
|
||||
@ -178,12 +177,10 @@ export function SelectBase<T>({
|
||||
components,
|
||||
}: SelectBaseProps<T>) {
|
||||
const theme = useTheme();
|
||||
const portalRef = useRef<HTMLDivElement>();
|
||||
const styles = getSelectStyles(theme);
|
||||
let ReactSelectComponent: ReactSelect | Creatable = ReactSelect;
|
||||
const creatableProps: any = {};
|
||||
let asyncSelectProps: any = {};
|
||||
|
||||
let selectedValue = [];
|
||||
if (isMulti && loadOptions) {
|
||||
selectedValue = value as any;
|
||||
@ -236,7 +233,6 @@ export function SelectBase<T>({
|
||||
renderControl,
|
||||
captureMenuScroll: false,
|
||||
blurInputOnSelect: true,
|
||||
menuPortalTarget: portalRef.current,
|
||||
menuPlacement: 'auto',
|
||||
};
|
||||
|
||||
@ -347,6 +343,7 @@ export function SelectBase<T>({
|
||||
width,
|
||||
position,
|
||||
marginBottom: !!bottom ? '10px' : '0',
|
||||
zIndex: 9999,
|
||||
}),
|
||||
}}
|
||||
className={widthClass}
|
||||
@ -354,7 +351,6 @@ export function SelectBase<T>({
|
||||
{...creatableProps}
|
||||
{...asyncSelectProps}
|
||||
/>
|
||||
<RefForwardingPortal ref={portalRef as any} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user