Problem/Motivation

When i remove an item, more items are removed.

Steps to reproduce

  • Create a content with 3 items on entityreference_rendered_widget.
  • Edit content and remove second item. Second and third items are removed

Proposed resolution

Fix EntityReferenceRenderedDisabled to set widgetState with items_count.

    $field_state = [
      'items_count' => count($items),
      'original_deltas' => [0 => 0],
    ];
    static::setWidgetState($form['#parents'], $name, $form_state, $field_state);

Comments

goz created an issue.