Revert "Added onInput event for fields in forms - fix for issue #7600"

This reverts commit 9125b496ae.
This commit is contained in:
rocheparadox 2024-08-24 17:42:49 +00:00
parent 3ae15db089
commit ae8d178475
2 changed files with 2 additions and 20 deletions

View File

@ -298,8 +298,7 @@ function constructDeleteForm(fields, options) {
* - closeText: Text for the "close" button
* - fields: list of fields to display, with the following options
* - filters: API query filters
* - onEdit: callback or array of callbacks which get fired when field is edited - does not get triggered until the field loses focus, ref: https://api.jquery.com/change/
* - onInput: callback or array of callbacks which get fired when an input is detected in the field
* - onEdit: callback or array of callbacks which get fired when field is edited
* - secondary: Define a secondary modal form for this field
* - label: Specify custom label
* - help_text: Specify custom help_text
@ -1662,23 +1661,6 @@ function addFieldCallback(name, field, options) {
});
}
if(field.onInput){
el.on('input', function(){
var value = getFormFieldValue(name, field, options);
let onInputHandlers = field.onInput;
if (!Array.isArray(onInputHandlers)) {
onInputHandlers = [onInputHandlers];
}
for (const onInput of onInputHandlers) {
onInput(value, name, field, options);
}
});
}
// attach field callback for nested fields
if(field.type === "nested object") {
for (const [c_name, c_field] of Object.entries(field.children)) {

View File

@ -343,7 +343,7 @@ function poLineItemFields(options={}) {
reference: {},
purchase_price: {
icon: 'fa-dollar-sign',
onInput: function(value, name, field, opts) {
onEdit: function(value, name, field, opts) {
updateFieldValue('auto_pricing', value === '', {}, opts);
}
},