hotfix: N2N init trigger

This commit is contained in:
RB 2025-05-23 10:05:13 +08:00
parent cb9e48b488
commit fdc365a51d

View file

@ -2453,12 +2453,14 @@ class RbFormN2NReference extends RbFormReference {
ids.push(item.id) ids.push(item.id)
} }
}) })
if (ids.length > 0) this.__select2.trigger('change')
if (ids.length > 0) { // v4.0.5 禁用因为初始化时就会触发
let ss = ids.join(',') // if (ids.length > 0) {
if (append && currentIds && currentIds !== '') ss = currentIds + ',' + ss // let ss = ids.join(',')
this.handleChange({ target: { value: ss } }, true) // if (append && currentIds && currentIds !== '') ss = currentIds + ',' + ss
} // this.handleChange({ target: { value: ss } }, true)
// }
} else { } else {
this.__select2.val(null).trigger('change') this.__select2.val(null).trigger('change')
} }