diff --git a/packages/editor/src/lib/components/default-components/DefaultCanvas.tsx b/packages/editor/src/lib/components/default-components/DefaultCanvas.tsx index 8646a366b..7d7215733 100644 --- a/packages/editor/src/lib/components/default-components/DefaultCanvas.tsx +++ b/packages/editor/src/lib/components/default-components/DefaultCanvas.tsx @@ -356,11 +356,9 @@ function ShapesToDisplay() { function SelectedIdIndicators() { const editor = useEditor() - const selectedShapeIds = useValue( - 'selectedShapeIds', - () => editor.getCurrentPageState().selectedShapeIds, - [editor] - ) + const selectedShapeIds = useValue('selectedShapeIds', () => editor.getSelectedShapeIds(), [ + editor, + ]) const shouldDisplay = useValue( 'should display selected ids', () => { diff --git a/packages/tldraw/src/lib/ui/hooks/clipboard/pasteTldrawContent.ts b/packages/tldraw/src/lib/ui/hooks/clipboard/pasteTldrawContent.ts index 912ddc70e..c7f6bb238 100644 --- a/packages/tldraw/src/lib/ui/hooks/clipboard/pasteTldrawContent.ts +++ b/packages/tldraw/src/lib/ui/hooks/clipboard/pasteTldrawContent.ts @@ -11,9 +11,22 @@ import { Editor, TLContent, VecLike } from '@tldraw/editor' export function pasteTldrawContent(editor: Editor, clipboard: TLContent, point?: VecLike) { const p = point ?? (editor.inputs.shiftKey ? editor.inputs.currentPagePoint : undefined) + const seletionBoundsBefore = editor.getSelectionPageBounds() editor.mark('paste') editor.putContentOntoCurrentPage(clipboard, { point: p, select: true, }) + const selectedBoundsAfter = editor.getSelectionPageBounds() + if ( + seletionBoundsBefore && + selectedBoundsAfter && + seletionBoundsBefore?.collides(selectedBoundsAfter) + ) { + // Creates a 'puff' to show a paste has happened. + editor.updateInstanceState({ isChangingStyle: true }) + setTimeout(() => { + editor.updateInstanceState({ isChangingStyle: false }) + }, 150) + } }