OG audience autocomplete renders draggable input for hidden reference item
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3556073. --> Reported by: [joelpittet](https://www.drupal.org/user/160302) Related to !63 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p> Follow-up to <a href="https://www.drupal.org/project/og/issues/3554116">#3554116</a>.</p> <p>Reported by @ramil g, thanks for the manual test discovery.</p> <p>When a piece of content has multiple OG audience references and one of those<br> groups is not visible to the current editor (e.g., a private group), the<br> <em>Entity reference autocomplete</em> widget still renders a second, hidden<br> autocomplete input and a draggable row for that hidden item. This leads to: </p> <ul> <li>Extra DOM inputs (e.g., three autocompletes: one visible, one hidden,<br> and one &ldquo;Add another item&rdquo;).</li> <li>A draggable handle present for an item the editor cannot interact with.</li> <li>Unnecessary UI noise and potential a11y/UX confusion.</li> </ul> <p> The hidden reference should be preserved but must not render an interactive<br> autocomplete input nor a draggable handle. </p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <ol> <li>Enable OG and add an OG audience field with <em>Autocomplete</em> widget<br> (multiple cardinality) to a content type.</li> <li>Create at least two groups, making one of them private (not visible to a<br> test editor).</li> <li>Create content that references both groups.</li> <li>Log in as the editor who cannot see the private group and open the edit<br> form for that content.</li> <li>Inspect the widget: you will see one visible autocomplete input, plus a<br> hidden autocomplete input for the private group, and the &ldquo;Add another<br> item&rdquo; input. The hidden item also has a draggable row/handle.</li> </ol> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>For 'groups' the 'group content' editor cannot access, hide the input item.</p> <h3 id="summary-ui-changes">User interface changes</h3> <ul> <li>No extra/ghost autocomplete inputs for hidden items.</li> <li>No draggable handle for hidden/uneditable references.</li> <li>Editors see only the inputs they can interact with, plus one &ldquo;Add another<br> item&rdquo;.</li> </ul>
issue