diff --git a/src/components/LayoutStep.tsx b/src/components/LayoutStep.tsx index bde04f1..40e739c 100644 --- a/src/components/LayoutStep.tsx +++ b/src/components/LayoutStep.tsx @@ -298,6 +298,16 @@ export const LayoutStep: React.FC = ({ config, splits, onChange }) => { } }; + // --- ДОБАВЛЕНО: Очистка при выходе мыши --- + const handleMouseLeave = () => { + setDragging(null); + setPhantomMainAxis(null); + setHoveredMainSplit(null); + setHoveredCell(null); + setHoveredPartition(null); + setPhantomPartition(null); + }; + // --- RENDER --- const renderCellsAndPartitions = () => { const elements = []; @@ -430,7 +440,12 @@ export const LayoutStep: React.FC = ({ config, splits, onChange }) => {
1 ? 'auto' : '100%', height: aspectRatio > 1 ? '100%' : 'auto', aspectRatio: `${1/aspectRatio}`, maxHeight: '100%', maxWidth: '100%', cursor: mode === 'lines' ? (dragging ? 'grabbing' : hoveredMainSplit ? 'col-resize' : 'crosshair') : (dragging ? 'grabbing' : hoveredPartition ? 'grab' : hoveredCell ? 'crosshair' : 'default') }}> - setDragging(null)} onMouseLeave={() => setDragging(null)} onContextMenu={(e) => e.preventDefault()}> + setDragging(null)} + onMouseLeave={handleMouseLeave} // ДОБАВЛЕН ОБРАБОТЧИК + onContextMenu={(e) => e.preventDefault()}> {renderCellsAndPartitions()}