mirror of
https://github.com/langgenius/dify.git
synced 2026-05-13 08:57:28 +08:00
fix(web): z-index of shortcut popup
This commit is contained in:
parent
74c4d720d4
commit
eadaaa1aa0
@ -203,7 +203,6 @@ const InputField: React.FC<InputFieldProps> = ({
|
||||
<TypeSelector
|
||||
value={tempPayload.type}
|
||||
items={fieldTypeItems}
|
||||
popupClassName="z-[1000000]"
|
||||
onSelect={handleTypeChange}
|
||||
/>
|
||||
</div>
|
||||
@ -260,7 +259,6 @@ const InputField: React.FC<InputFieldProps> = ({
|
||||
onChange={handleSelectOptionSourceSelectorChange}
|
||||
readonly={false}
|
||||
isJustShowValue
|
||||
zIndex={1000000}
|
||||
filterVar={varPayload => varPayload.type === VarType.arrayString}
|
||||
/>
|
||||
<TypeSwitch
|
||||
|
||||
@ -29,7 +29,6 @@ type PlaceholderProps = {
|
||||
value: ValueSelector
|
||||
onChange: (valueSelector: ValueSelector | string) => void
|
||||
readonly: boolean
|
||||
zIndex: number
|
||||
filterVar: (varPayload: Var) => boolean
|
||||
isJustShowValue?: boolean
|
||||
}
|
||||
@ -85,7 +84,6 @@ const PrePopulate: FC<Props> = ({
|
||||
value: valueSelector || [],
|
||||
onChange: onValueSelectorChange!,
|
||||
readonly: false,
|
||||
zIndex: 1000000, // bigger than shortcut plugin popup
|
||||
filterVar: (varPayload: Var) => {
|
||||
return [VarType.string, VarType.number, VarType.secret].includes(varPayload.type)
|
||||
},
|
||||
|
||||
@ -186,7 +186,9 @@ describe('ShortcutsPopupPlugin', () => {
|
||||
render(<MinimalEditor withContainer={false} />)
|
||||
focusAndTriggerHotkey('/')
|
||||
const portalContent = await screen.findByText(SHORTCUTS_EMPTY_CONTENT)
|
||||
const floatingDiv = portalContent.closest('div')
|
||||
expect(document.body).toContainElement(portalContent)
|
||||
expect(floatingDiv).toHaveClass('z-1002')
|
||||
})
|
||||
|
||||
// ─── matchHotkey: string hotkey ───
|
||||
|
||||
@ -236,7 +236,7 @@ export default function ShortcutsPopupPlugin({
|
||||
|
||||
setOpen(true)
|
||||
onOpen?.()
|
||||
}, [onOpen])
|
||||
}, [editor, onOpen, refs])
|
||||
|
||||
const closePortal = useCallback(() => {
|
||||
setOpen(false)
|
||||
@ -298,7 +298,7 @@ export default function ShortcutsPopupPlugin({
|
||||
refs.setFloating(node)
|
||||
}}
|
||||
className={cn(
|
||||
useContainer ? '' : 'z-999999',
|
||||
useContainer ? '' : 'z-1002',
|
||||
'absolute rounded-xl bg-components-panel-bg-blur shadow-lg',
|
||||
className,
|
||||
)}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
/* eslint-disable react/no-context-provider -- use-context-selector contexts require .Provider in tests. */
|
||||
import type { ReactNode } from 'react'
|
||||
import type { EmailConfig, FormInputItem } from '../../../types'
|
||||
import type { EmailConfig, FormInputItem, ParagraphFormInput, SelectFormInput } from '../../../types'
|
||||
import type { CodeNodeType } from '@/app/components/workflow/nodes/code/types'
|
||||
import type { App, AppSSO } from '@/types/app'
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
import { fireEvent, render, screen, waitFor } from '@testing-library/react'
|
||||
@ -7,6 +9,7 @@ import userEvent from '@testing-library/user-event'
|
||||
import { useStore as useAppStore } from '@/app/components/app/store'
|
||||
import { HooksStoreContext } from '@/app/components/workflow/hooks-store/provider'
|
||||
import { createHooksStore } from '@/app/components/workflow/hooks-store/store'
|
||||
import { CodeLanguage } from '@/app/components/workflow/nodes/code/types'
|
||||
import { BlockEnum, InputVarType, VarType } from '@/app/components/workflow/types'
|
||||
import { AppContext, initialLangGeniusVersionInfo, initialWorkspaceInfo, userProfilePlaceholder } from '@/context/app-context'
|
||||
import EmailSenderModal from '../test-email-sender'
|
||||
@ -145,7 +148,7 @@ const createConfig = (overrides: Partial<EmailConfig> = {}): EmailConfig => ({
|
||||
...overrides,
|
||||
})
|
||||
|
||||
const createFormInput = (overrides: Partial<FormInputItem> = {}): FormInputItem => ({
|
||||
const createFormInput = (overrides: Partial<ParagraphFormInput> = {}): FormInputItem => ({
|
||||
type: InputVarType.paragraph,
|
||||
output_variable_name: 'user_name',
|
||||
default: {
|
||||
@ -156,7 +159,7 @@ const createFormInput = (overrides: Partial<FormInputItem> = {}): FormInputItem
|
||||
...overrides,
|
||||
})
|
||||
|
||||
const createDynamicSelectInput = (): FormInputItem => ({
|
||||
const createDynamicSelectInput = (): SelectFormInput => ({
|
||||
type: InputVarType.select,
|
||||
output_variable_name: 'decision',
|
||||
option_source: {
|
||||
@ -278,7 +281,7 @@ describe('human-input/delivery-method/test-email-sender', () => {
|
||||
desc: '',
|
||||
type: BlockEnum.Code,
|
||||
variables: [],
|
||||
code_language: 'python3',
|
||||
code_language: CodeLanguage.python3,
|
||||
code: '',
|
||||
outputs: {
|
||||
result: {
|
||||
@ -286,7 +289,7 @@ describe('human-input/delivery-method/test-email-sender', () => {
|
||||
children: null,
|
||||
},
|
||||
},
|
||||
},
|
||||
} as CodeNodeType,
|
||||
},
|
||||
]}
|
||||
nodesOutputVars={[
|
||||
|
||||
Loading…
Reference in New Issue
Block a user