@@ -2852,7 +2852,17 @@ export class LGraphNode
2852
2852
output . links ??= [ ]
2853
2853
output . links . push ( link . id )
2854
2854
// connect in input
2855
- inputNode . inputs [ inputIndex ] . link = link . id
2855
+ const targetInput = inputNode . inputs [ inputIndex ]
2856
+ targetInput . link = link . id
2857
+ if ( targetInput . widget ) {
2858
+ graph . trigger ( 'node:slot-links:changed' , {
2859
+ nodeId : inputNode . id ,
2860
+ slotType : NodeSlotType . INPUT ,
2861
+ slotIndex : inputIndex ,
2862
+ connected : true ,
2863
+ linkId : link . id
2864
+ } )
2865
+ }
2856
2866
2857
2867
// Reroutes
2858
2868
const reroutes = LLink . getReroutes ( graph , link )
@@ -3009,6 +3019,15 @@ export class LGraphNode
3009
3019
const input = target . inputs [ link_info . target_slot ]
3010
3020
// remove there
3011
3021
input . link = null
3022
+ if ( input . widget ) {
3023
+ graph . trigger ( 'node:slot-links:changed' , {
3024
+ nodeId : target . id ,
3025
+ slotType : NodeSlotType . INPUT ,
3026
+ slotIndex : link_info . target_slot ,
3027
+ connected : false ,
3028
+ linkId : link_info . id
3029
+ } )
3030
+ }
3012
3031
3013
3032
// remove the link from the links pool
3014
3033
link_info . disconnect ( graph , 'input' )
@@ -3045,6 +3064,15 @@ export class LGraphNode
3045
3064
const input = target . inputs [ link_info . target_slot ]
3046
3065
// remove other side link
3047
3066
input . link = null
3067
+ if ( input . widget ) {
3068
+ graph . trigger ( 'node:slot-links:changed' , {
3069
+ nodeId : target . id ,
3070
+ slotType : NodeSlotType . INPUT ,
3071
+ slotIndex : link_info . target_slot ,
3072
+ connected : false ,
3073
+ linkId : link_info . id
3074
+ } )
3075
+ }
3048
3076
3049
3077
// link_info hasn't been modified so its ok
3050
3078
target . onConnectionsChange ?.(
@@ -3114,6 +3142,15 @@ export class LGraphNode
3114
3142
const link_id = this . inputs [ slot ] . link
3115
3143
if ( link_id != null ) {
3116
3144
this . inputs [ slot ] . link = null
3145
+ if ( input . widget ) {
3146
+ graph . trigger ( 'node:slot-links:changed' , {
3147
+ nodeId : this . id ,
3148
+ slotType : NodeSlotType . INPUT ,
3149
+ slotIndex : slot ,
3150
+ connected : false ,
3151
+ linkId : link_id
3152
+ } )
3153
+ }
3117
3154
3118
3155
// remove other side
3119
3156
const link_info = graph . _links . get ( link_id )
0 commit comments