File field titles look different from URL fields with which they are often paired with because they are collapsible; they shouldn't be collapsible

OK so i just switched to Bulma as the admin theme, and it uses form-element.html.twig without a mention of the details.html.twig that Claro is using. So this is theme dependent.

Same with the Seven theme. So it’s just Claro adding this.

Now in Drupal 8 all collapsible fieldsets have been replaced with HTML5 details elements, but that’s not my problem; my problem is that Claro is insisting on putting file fields in a collapsible fieldset—sorry, an HTML5 details element, that is also collapsible—in the first place.

Reading the last patch in the issue about Claro’s file field style update gave a workaround.

It’s doing a lot of heavy lifting in , some check it seems to do to make sure it doesn’t wrap anything twice gives me a way to tell it not to wrap an element in the first place, simply by making sure $element['#single_wrapped'] has a value, any value:

Here’s my commit with a quick proof of concept:

  // Prevent Claro from adding a Details wrapper around our file fields.
  $form['field_findit_flier']['widget'][0]['#single_wrapped'] = 'skip';