forked from 77media/video-flow
修复 聚焦 冲突问题
This commit is contained in:
parent
1f049a97d7
commit
540737210d
@ -178,6 +178,7 @@ const WorkFlow = React.memo(function WorkFlow() {
|
||||
<div className="imageGrid-ymZV9z hide-scrollbar">
|
||||
<ErrorBoundary>
|
||||
<ThumbnailGrid
|
||||
isEditModalOpen={isEditModalOpen}
|
||||
taskObject={taskObject}
|
||||
isLoading={isLoading}
|
||||
currentSketchIndex={currentSketchIndex}
|
||||
|
||||
@ -8,6 +8,7 @@ import { Loader2, X } from 'lucide-react';
|
||||
import { TaskObject } from '@/api/DTO/movieEdit';
|
||||
|
||||
interface ThumbnailGridProps {
|
||||
isEditModalOpen: boolean;
|
||||
taskObject: TaskObject;
|
||||
isLoading: boolean;
|
||||
currentSketchIndex: number;
|
||||
@ -21,6 +22,7 @@ interface ThumbnailGridProps {
|
||||
}
|
||||
|
||||
export function ThumbnailGrid({
|
||||
isEditModalOpen,
|
||||
taskObject,
|
||||
isLoading,
|
||||
currentSketchIndex,
|
||||
@ -122,7 +124,7 @@ export function ThumbnailGrid({
|
||||
// 监听键盘事件
|
||||
useEffect(() => {
|
||||
// 组件挂载时自动聚焦
|
||||
if (thumbnailsRef.current) {
|
||||
if (thumbnailsRef.current && !isEditModalOpen) {
|
||||
thumbnailsRef.current.focus();
|
||||
}
|
||||
|
||||
@ -132,7 +134,7 @@ export function ThumbnailGrid({
|
||||
|
||||
// 确保在数据变化时保持焦点
|
||||
useEffect(() => {
|
||||
if (thumbnailsRef.current && !isFocused) {
|
||||
if (thumbnailsRef.current && !isFocused && !isEditModalOpen) {
|
||||
thumbnailsRef.current.focus();
|
||||
}
|
||||
}, [taskObject.currentStage, isFocused]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user