Hi everyone, I have a problem that has proven itself to be rather elusive:
Custom TextAreaEntry-fields that I add to the panel loose focus as soon as I stop typing in them. I know that this is not a general bug, because it works fine in the example project. However, I cannot tell where my setup differes from the example in a way that would explain this. Unfortunately, I am not at liberty to share the entire project, so I’ll try to explain it based on the relevant code snippets:
function serviceTaskFields(module, businessObject, bpmnFactory, properties, element) {
// add fields
for (let f in module.fields) {
let field = module.fields[f];
const getValue = () => {
return getExpression(
businessObject,
field.id,
field.default
);
};
const setValue = (element, value, modeling) => {
setExpression(
bpmnFactory,
businessObject,
field.id,
value
);
element = element.labelTarget || element;
return modeling.updateProperties(element, {});
}
if (field.type === "text") {
// textbox
properties.push({
id: field.id,
element,
component: () => {
const modeling = useService('modeling');
const debounce = useService('debounceInput');
return <TextAreaEntry
id={field.id}
element={element}
description={field.description}
label={field.name}
getValue={getValue}
setValue={(value) => setValue(element, value, modeling)}
debounce={debounce}
/>
},
isEdited: isTextAreaEntryEdited
})
}
}
}
As you can see I usually handle the actual value setting in a separate function, but even if I comment that out the error persists. If I comment out return modeling.updateProperties(element, {});
as well the input field does not loose focus anymore (but I obviously also loose my changes).
If anyone has a clue as to why the TextAreaEntry would loose focus I’d be very grateful. Personally I’m at a bit of a loss, because I can’t come up with any situation in which I would want the input to loose focus.