Add elevateNodesOnSelect prop, fix z-index not increased when selecting nodes
This commit is contained in:
@@ -64,6 +64,7 @@
|
|||||||
colorModeSSR,
|
colorModeSSR,
|
||||||
style,
|
style,
|
||||||
defaultEdgeOptions,
|
defaultEdgeOptions,
|
||||||
|
elevateNodesOnSelect,
|
||||||
...divAttributes
|
...divAttributes
|
||||||
} = $derived(rest);
|
} = $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.
|
* 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
|
* @default (connection: Connection) => true
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** Enabling this option will raise the z-index of nodes when they are selected.
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
elevateNodesOnSelect?: boolean;
|
||||||
isValidConnection?: IsValidConnection;
|
isValidConnection?: IsValidConnection;
|
||||||
/** This event handler is called when the user begins to pan or zoom the viewport */
|
/** This event handler is called when the user begins to pan or zoom the viewport */
|
||||||
onMoveStart?: OnMoveStart;
|
onMoveStart?: OnMoveStart;
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ export const getInitialStore = (signals: StoreSignals) => {
|
|||||||
adoptUserNodes(signals.nodes, this.nodeLookup, this.parentLookup, {
|
adoptUserNodes(signals.nodes, this.nodeLookup, this.parentLookup, {
|
||||||
nodeExtent: this.nodeExtent,
|
nodeExtent: this.nodeExtent,
|
||||||
nodeOrigin: this.nodeOrigin,
|
nodeOrigin: this.nodeOrigin,
|
||||||
elevateNodesOnSelect: false,
|
elevateNodesOnSelect: signals.props.elevateNodesOnSelect ?? true,
|
||||||
checkEquality: true
|
checkEquality: true
|
||||||
});
|
});
|
||||||
return signals.nodes;
|
return signals.nodes;
|
||||||
|
|||||||
Reference in New Issue
Block a user