streamline onselectionchange
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import {
|
||||
Handle,
|
||||
Position,
|
||||
useSelectionChanged,
|
||||
useOnSelectionChange,
|
||||
type BuiltInNode,
|
||||
type NodeProps
|
||||
} from '@xyflow/svelte';
|
||||
@@ -13,7 +13,7 @@
|
||||
positionAbsoluteY = 0
|
||||
}: NodeProps<BuiltInNode> = $props();
|
||||
|
||||
useSelectionChanged(({ nodes, edges }) => {
|
||||
useOnSelectionChange(({ nodes, edges }) => {
|
||||
console.log('on selection changed via hook', { nodes, edges });
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
connectionMode={ConnectionMode.Strict}
|
||||
attributionPosition={'top-center'}
|
||||
deleteKey={['Backspace', 'd']}
|
||||
onselectionchanged={({ nodes, edges }) => {
|
||||
onselectionchange={({ nodes, edges }) => {
|
||||
console.log('on selection changed via prop', { nodes, edges });
|
||||
}}
|
||||
selectNodesOnDrag
|
||||
|
||||
Reference in New Issue
Block a user