Selaa lähdekoodia

fix: prevent nodes from being unintentionally deleted by pressing the backspace key. (#21023)

tags/1.5.0
kurokobo 4 kuukautta sitten
vanhempi
commit
df6451076b
No account linked to committer's email address

+ 1
- 0
web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx Näytä tiedosto

@@ -165,6 +165,7 @@ const ComponentPicker = ({
isSupportFileVar={isSupportFileVar}
onClose={handleClose}
onBlur={handleClose}
autoFocus={false}
/>
</div>
)

+ 1
- 1
web/app/components/workflow/hooks/use-shortcuts.ts Näytä tiedosto

@@ -61,7 +61,7 @@ export const useShortcuts = (): void => {
return !showFeaturesPanel && !isEventTargetInputArea(e.target as HTMLElement)
}, [workflowStore])

useKeyPress(['delete', 'backspace'], (e) => {
useKeyPress(['delete'], (e) => {
if (shouldHandleShortcut(e)) {
e.preventDefault()
handleNodesDelete()

+ 3
- 1
web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx Näytä tiedosto

@@ -260,6 +260,7 @@ type Props = {
maxHeightClass?: string
onClose?: () => void
onBlur?: () => void
autoFocus?: boolean
}
const VarReferenceVars: FC<Props> = ({
hideSearch,
@@ -271,6 +272,7 @@ const VarReferenceVars: FC<Props> = ({
maxHeightClass,
onClose,
onBlur,
autoFocus = true,
}) => {
const { t } = useTranslation()
const [searchText, setSearchText] = useState('')
@@ -323,7 +325,7 @@ const VarReferenceVars: FC<Props> = ({
onKeyDown={handleKeyDown}
onClear={() => setSearchText('')}
onBlur={onBlur}
autoFocus
autoFocus={autoFocus}
/>
</div>
<div className='relative left-[-4px] h-[0.5px] bg-black/5' style={{

Loading…
Peruuta
Tallenna