UI State dirty don't always change

Hallo,

in one of our forms we are using inline repeats which contain number and string fields.
blockeditor.form.json (25.3 KB) blockeditor.json (13.9 KB).
At the moment we are implementing a costum version for the “apply” button, so we can display the button as disabled until something has changed. For detecting whether the form is dirty or not we use UiStateSelectors.dirty()(state) and the dirty attribute of the activity.
Now I recognized that if I change something in the number field in the inline repeat the ui state changes immediately and also the button can change immediately to enabeld. But for the string field in the inline repeat it doesn’t change. There I have to trigger the blur, so that the activity attribute is true to get the button enabled.
I don’t think this is an excepted behaviour, isn’t it? So has or had anyone else the same problem or is just something going wrong by us? And if so, has any one a suggestions what could possibly go wrong by us?
Thanks in advance for any hint.

Best regards,
Nora

i think it is the expected behaviour since i think thats because text line stateful is used in the implementation of form-engine, see widget description here:
<INTERNAL_LINK>
and component map of form-engine here:
<INTERNAL_LINK>

Hallo Markus,

thank you for your answer.
Should then be the behaviour for string field outside of inline repeats the same? Because this is not the case. Outside of inline repeat a change in a string field changes the ui state immediatly (as far as I remeber).

Best regards
Nora

Hi,

after debugging with @mschmidt_inactive through our code, we found out, that the problem lies by us (and not the form engine).
For the addressed field we use a custom field. In the implementation of the custom field we forgot to set the uiState to dirty by calling this.props.config.renderOptions.eventHandlers.onInputTouched()

thx for sharing :slight_smile: :+1: