Add elevateNodesOnSelect prop, fix z-index not increased when selecting nodes
This commit is contained in:
@@ -64,6 +64,7 @@
|
||||
colorModeSSR,
|
||||
style,
|
||||
defaultEdgeOptions,
|
||||
elevateNodesOnSelect,
|
||||
...divAttributes
|
||||
} = $derived(rest);
|
||||
|
||||
|
||||
@@ -328,6 +328,11 @@ export type SvelteFlowProps = NodeEvents &
|
||||
* If you have custom connection logic its preferred to use this callback over the isValidConnection prop on the handle component for performance reasons.
|
||||
* @default (connection: Connection) => true
|
||||
*/
|
||||
|
||||
/** Enabling this option will raise the z-index of nodes when they are selected.
|
||||
* @default true
|
||||
*/
|
||||
elevateNodesOnSelect?: boolean;
|
||||
isValidConnection?: IsValidConnection;
|
||||
/** This event handler is called when the user begins to pan or zoom the viewport */
|
||||
onMoveStart?: OnMoveStart;
|
||||
|
||||
@@ -82,7 +82,7 @@ export const getInitialStore = (signals: StoreSignals) => {
|
||||
adoptUserNodes(signals.nodes, this.nodeLookup, this.parentLookup, {
|
||||
nodeExtent: this.nodeExtent,
|
||||
nodeOrigin: this.nodeOrigin,
|
||||
elevateNodesOnSelect: false,
|
||||
elevateNodesOnSelect: signals.props.elevateNodesOnSelect ?? true,
|
||||
checkEquality: true
|
||||
});
|
||||
return signals.nodes;
|
||||
|
||||
Reference in New Issue
Block a user