소스 검색

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

tags/1.5.0
kurokobo 4 달 전
부모
커밋
df6451076b
No account linked to committer's email address

+ 1
- 0
web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx 파일 보기

isSupportFileVar={isSupportFileVar} isSupportFileVar={isSupportFileVar}
onClose={handleClose} onClose={handleClose}
onBlur={handleClose} onBlur={handleClose}
autoFocus={false}
/> />
</div> </div>
) )

+ 1
- 1
web/app/components/workflow/hooks/use-shortcuts.ts 파일 보기

return !showFeaturesPanel && !isEventTargetInputArea(e.target as HTMLElement) return !showFeaturesPanel && !isEventTargetInputArea(e.target as HTMLElement)
}, [workflowStore]) }, [workflowStore])


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

+ 3
- 1
web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx 파일 보기

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

Loading…
취소
저장