Skip to content

Commit

Permalink
fix(editor) Reparenting sets the elements to re-render correctly. (#6361
Browse files Browse the repository at this point in the history
)

- `applyGridReparent` invokes `setElementsToRerenderCommand`.
- `baseFlexReparentToAbsoluteStrategy` invokes
`setElementsToRerenderCommand`.
  • Loading branch information
seanparsons authored Sep 16, 2024
1 parent 677269a commit 31d2174
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { canvasPoint } from '../../../../core/shared/math-utils'
import type { EditorStatePatch } from '../../../editor/store/editor-state'
import { foldAndApplyCommandsInner } from '../../commands/commands'
import { setElementsToRerenderCommand } from '../../commands/set-elements-to-rerender-command'
import { updateFunctionCommand } from '../../commands/update-function-command'
import { ParentBounds } from '../../controls/parent-bounds'
import { ParentOutlines } from '../../controls/parent-outlines'
Expand Down Expand Up @@ -104,6 +105,10 @@ export function baseFlexReparentToAbsoluteStrategy(
[
...placeholderCommands.commands,
...escapeHatchCommands,
setElementsToRerenderCommand([
newParent.intendedParentPath,
...filteredSelectedElements,
]),
updateFunctionCommand(
'always',
(editorState, commandLifecycle): Array<EditorStatePatch> => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import type { ReparentTarget } from './reparent-helpers/reparent-strategy-helper
import { getReparentOutcome, pathToReparent } from './reparent-utils'
import { flattenSelection } from './shared-move-strategies-helpers'
import type { GridCellCoordinates } from './grid-cell-bounds'
import { setElementsToRerenderCommand } from '../../commands/set-elements-to-rerender-command'

export function gridReparentStrategy(
reparentTarget: ReparentTarget,
Expand Down Expand Up @@ -258,6 +259,7 @@ export function applyGridReparent(
updateSelectedViews('always', newPaths),
setCursorCommand(CSSCursor.Reparent),
showGridControls('mid-interaction', reparentTarget.newParent.intendedParentPath),
setElementsToRerenderCommand(elementsToRerender),
],
{
elementsToRerender: elementsToRerender,
Expand Down

0 comments on commit 31d2174

Please sign in to comment.