@@ -2840,7 +2840,17 @@ export class LGraphNode
2840
2840
output . links ??= [ ]
2841
2841
output . links . push ( link . id )
2842
2842
// connect in input
2843
- inputNode . inputs [ inputIndex ] . link = link . id
2843
+ const targetInput = inputNode . inputs [ inputIndex ]
2844
+ targetInput . link = link . id
2845
+ if ( targetInput . widget ) {
2846
+ graph . trigger ( 'node:slot-links:changed' , {
2847
+ nodeId : inputNode . id ,
2848
+ slotType : NodeSlotType . INPUT ,
2849
+ slotIndex : inputIndex ,
2850
+ connected : true ,
2851
+ linkId : link . id
2852
+ } )
2853
+ }
2844
2854
2845
2855
// Reroutes
2846
2856
const reroutes = LLink . getReroutes ( graph , link )
@@ -2997,6 +3007,15 @@ export class LGraphNode
2997
3007
const input = target . inputs [ link_info . target_slot ]
2998
3008
// remove there
2999
3009
input . link = null
3010
+ if ( input . widget ) {
3011
+ graph . trigger ( 'node:slot-links:changed' , {
3012
+ nodeId : target . id ,
3013
+ slotType : NodeSlotType . INPUT ,
3014
+ slotIndex : link_info . target_slot ,
3015
+ connected : false ,
3016
+ linkId : link_info . id
3017
+ } )
3018
+ }
3000
3019
3001
3020
// remove the link from the links pool
3002
3021
link_info . disconnect ( graph , 'input' )
@@ -3033,6 +3052,15 @@ export class LGraphNode
3033
3052
const input = target . inputs [ link_info . target_slot ]
3034
3053
// remove other side link
3035
3054
input . link = null
3055
+ if ( input . widget ) {
3056
+ graph . trigger ( 'node:slot-links:changed' , {
3057
+ nodeId : target . id ,
3058
+ slotType : NodeSlotType . INPUT ,
3059
+ slotIndex : link_info . target_slot ,
3060
+ connected : false ,
3061
+ linkId : link_info . id
3062
+ } )
3063
+ }
3036
3064
3037
3065
// link_info hasn't been modified so its ok
3038
3066
target . onConnectionsChange ?.(
@@ -3102,6 +3130,15 @@ export class LGraphNode
3102
3130
const link_id = this . inputs [ slot ] . link
3103
3131
if ( link_id != null ) {
3104
3132
this . inputs [ slot ] . link = null
3133
+ if ( input . widget ) {
3134
+ graph . trigger ( 'node:slot-links:changed' , {
3135
+ nodeId : this . id ,
3136
+ slotType : NodeSlotType . INPUT ,
3137
+ slotIndex : slot ,
3138
+ connected : false ,
3139
+ linkId : link_id
3140
+ } )
3141
+ }
3105
3142
3106
3143
// remove other side
3107
3144
const link_info = graph . _links . get ( link_id )
0 commit comments