Fix: #3587778 Extra empty row when opening a closed-mode paragraph

Outer paragraphs widget configured with edit_mode = closed → the inner subform isn't rendered on initial form load. The user clicks "Edit" to open the paragraph, which triggers an AJAX rebuild — and that's the inner field's first render. The previous SKIP rule treated any AJAX rebuild as a "user action" and short-circuited the strip + items_count alignment, leaving an extra empty row visible beneath the saved value.

Narrow the trigger check: only treat the rebuild as a count-changing user action when the triggering element's #name suffix is _add_more or _remove_button (the multi-value Add another / Remove buttons that actually modify items_count). All other AJAX rebuilds — paragraph open/close, validation re-renders, save, etc. — go through the same strip + initial-render decrement as a fresh GET.

Add testClosedModeParagraphOpenHidesTrailingEmpty reproducing the exact reported flow: configure outer paragraphs with closed mode, save a populated paragraph, edit, click the paragraph Edit button, assert exactly the saved-value count visible.

@see https://www.drupal.org/project/multi_value_add_hider/issues/3587778

Closes #3587778

Merge request reports

Loading