Skip to content

Commit

Permalink
refactor(core): inherit attrs on edge path el in BaseEdge (#1742)
Browse files Browse the repository at this point in the history
* refactor(core): inherit attrs on edge path el in base edge

Signed-off-by: braks <[email protected]>

* chore(changeset): add

Signed-off-by: braks <[email protected]>

---------

Signed-off-by: braks <[email protected]>
  • Loading branch information
bcakmakoglu committed Jan 12, 2025
1 parent 0a0d8af commit 44b9232
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/stale-radios-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vue-flow/core": minor
---

Inherit attributes on main edge path element in BaseEdge component.
5 changes: 2 additions & 3 deletions packages/core/src/components/Edges/BaseEdge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ref, useAttrs } from 'vue'
import type { BaseEdgeProps } from '../../types'
import EdgeText from './EdgeText.vue'
const { interactionWidth = 20, labelShowBg = true, ...props } = defineProps<BaseEdgeProps>()
withDefaults(defineProps<BaseEdgeProps>(), { interactionWidth: 20 })
const pathEl = ref<SVGPathElement | null>(null)
Expand All @@ -30,12 +30,11 @@ export default {

<template>
<path
v-bind="attrs"
:id="id"
ref="pathEl"
:d="path"
:style="props.style"
class="vue-flow__edge-path"
:class="attrs.class"
:marker-end="markerEnd"
:marker-start="markerStart"
/>
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/types/edge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ export interface BaseEdgeProps extends EdgeLabelOptions {
markerStart?: string
markerEnd?: string
interactionWidth?: number
style?: CSSProperties
}

export type BezierEdgeProps = EdgePositions &
Expand Down

0 comments on commit 44b9232

Please sign in to comment.