fix z-index

pull/22091/head
JzoNg 11 months ago
parent b2b74e66ad
commit e3bf73c0e3

@ -437,6 +437,7 @@ const VarReferencePicker: FC<Props> = ({
onChange={handleVarReferenceChange} onChange={handleVarReferenceChange}
itemWidth={isAddBtnTrigger ? 260 : (minWidth || triggerWidth)} itemWidth={isAddBtnTrigger ? 260 : (minWidth || triggerWidth)}
isSupportFileVar={isSupportFileVar} isSupportFileVar={isSupportFileVar}
zIndex={zIndex}
/> />
)} )}
</PortalToFollowElemContent> </PortalToFollowElemContent>

@ -15,6 +15,7 @@ type Props = {
onChange: (value: ValueSelector, varDetail: Var) => void onChange: (value: ValueSelector, varDetail: Var) => void
itemWidth?: number itemWidth?: number
isSupportFileVar?: boolean isSupportFileVar?: boolean
zIndex?: number
} }
const VarReferencePopup: FC<Props> = ({ const VarReferencePopup: FC<Props> = ({
vars, vars,
@ -22,6 +23,7 @@ const VarReferencePopup: FC<Props> = ({
onChange, onChange,
itemWidth, itemWidth,
isSupportFileVar = true, isSupportFileVar = true,
zIndex,
}) => { }) => {
const { t } = useTranslation() const { t } = useTranslation()
const { locale } = useContext(I18n) const { locale } = useContext(I18n)
@ -57,6 +59,7 @@ const VarReferencePopup: FC<Props> = ({
onChange={onChange} onChange={onChange}
itemWidth={itemWidth} itemWidth={itemWidth}
isSupportFileVar={isSupportFileVar} isSupportFileVar={isSupportFileVar}
zIndex={zIndex}
/> />
} }
</div > </div >

@ -46,6 +46,7 @@ type ItemProps = {
isSupportFileVar?: boolean isSupportFileVar?: boolean
isException?: boolean isException?: boolean
isLoopVar?: boolean isLoopVar?: boolean
zIndex?: number
} }
const objVarTypes = [VarType.object, VarType.file] const objVarTypes = [VarType.object, VarType.file]
@ -60,6 +61,7 @@ const Item: FC<ItemProps> = ({
isSupportFileVar, isSupportFileVar,
isException, isException,
isLoopVar, isLoopVar,
zIndex,
}) => { }) => {
const isStructureOutput = itemData.type === VarType.object && (itemData.children as StructuredOutput)?.schema?.properties const isStructureOutput = itemData.type === VarType.object && (itemData.children as StructuredOutput)?.schema?.properties
const isFile = itemData.type === VarType.file && !isStructureOutput const isFile = itemData.type === VarType.file && !isStructureOutput
@ -171,7 +173,7 @@ const Item: FC<ItemProps> = ({
</div > </div >
</PortalToFollowElemTrigger > </PortalToFollowElemTrigger >
<PortalToFollowElemContent style={{ <PortalToFollowElemContent style={{
zIndex: 100, zIndex: zIndex || 100,
}}> }}>
{(isStructureOutput || isObj) && ( {(isStructureOutput || isObj) && (
<PickerStructurePanel <PickerStructurePanel
@ -260,6 +262,7 @@ type Props = {
maxHeightClass?: string maxHeightClass?: string
onClose?: () => void onClose?: () => void
onBlur?: () => void onBlur?: () => void
zIndex?: number
} }
const VarReferenceVars: FC<Props> = ({ const VarReferenceVars: FC<Props> = ({
hideSearch, hideSearch,
@ -271,6 +274,7 @@ const VarReferenceVars: FC<Props> = ({
maxHeightClass, maxHeightClass,
onClose, onClose,
onBlur, onBlur,
zIndex,
}) => { }) => {
const { t } = useTranslation() const { t } = useTranslation()
const [searchText, setSearchText] = useState('') const [searchText, setSearchText] = useState('')
@ -355,6 +359,7 @@ const VarReferenceVars: FC<Props> = ({
isSupportFileVar={isSupportFileVar} isSupportFileVar={isSupportFileVar}
isException={v.isException} isException={v.isException}
isLoopVar={item.isLoop} isLoopVar={item.isLoop}
zIndex={zIndex}
/> />
))} ))}
</div>)) </div>))

Loading…
Cancel
Save