Allow other contrib modules to mark their field widgets as childless so FWA actions still appear
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3578202. --> Reported by: [scott_euser](https://www.drupal.org/user/3267594) >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>As discussed in #3563961 and #3546465, field widget type dependencies (like `chosen_select` or `tagify`) are currently hard-coded as 'childless' elements for Field Widget Action plugins. Childless elements need wrapping in a parent in order for the FWA button to show up. There does not seem to be a straightforward way to detect whether a field widget has a <code>{{ children }}</code> element being output. </p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>Attempt to enable a Field Widget Action on a custom or unlisted field widget type that does not render child elements. The action buttons will not be available because the widget type isn't hard-coded in the plugin's supported list.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <ol> <li>Introduce an alter hook (e.g., `hook_field_widget_actions_supported_widgets_alter` or similar) to allow custom modules to dynamically inject or alter the list of field widgets that are childless for FWA plugins. </li> <li>Or come up with some way to auto-detect (cannot see such a way)</li> </ol> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>Define the alter hook, implement it where widget types are evaluated, and add relevant test coverage.</p> <h3 id="summary-ui-changes">User interface changes</h3> <p>N/A</p> <h3 id="summary-api-changes">API changes</h3> <p>A new alter hook will be introduced to the API to allow altering supported field widgets.</p> <h3 id="summary-data-model-changes">Data model changes</h3> <p>N/A</p>
issue