Skip to content

Commit

Permalink
fix(generator): the forms in visual area and preview area are inconsi…
Browse files Browse the repository at this point in the history
…stent (#152)

After setting containerstyle, the forms in visual area and preview area are inconsistent
  • Loading branch information
mengshang918 committed Mar 10, 2022
1 parent e633bb4 commit 4f90853
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
// import Placeholder from '../CustomComponents/Placeholder'
import { useCanDrop } from '@generator/hooks'
import DragItem from '@generator/components/LeftSideBar/DragAtom/Item'
import { useContainerStyle } from '@jdfed/hooks'
import ActiveTools from '../ActiveTools'
import type { FC } from 'react'
import type { ContainerStyle, ClosestEdge } from '@jdfed/utils'
Expand Down Expand Up @@ -54,6 +55,7 @@ const DripFormDragHoc: FC<Props> = memo(
parentMode,
isFirst,
}) => {
const newContainerStyle = useContainerStyle('edit', containerStyle)
const [ref, setRef] = useState<HTMLElement | null>(null)
const allField = useRecoilValue(allFieldAtom)
// 对象、数组容器为空(改变碰撞检测算法实现)
Expand Down Expand Up @@ -144,7 +146,7 @@ const DripFormDragHoc: FC<Props> = memo(
)}
onClick={onSelect}
style={{
width: containerStyle?.width || '100%',
...newContainerStyle,
}}
>
{selectedFieldKey === fieldKey && viewportConfig.showActionBar && (
Expand Down

0 comments on commit 4f90853

Please sign in to comment.