The summary field is a disclosure: a control reveals a second textarea. The current widget builds the control inside the Body label and replaces it on use, so focus is lost, the name changes and the control has no expanded state. The proposal is one persistent button outside the labels, immediately before the summary, with aria-expanded and a stable name.

The field type now lives in the contributed Text With Summary project. This demonstration is a simplified model: it reproduces the markup and the interaction, not the module’s jQuery or Drupal’s form API.

What changes in the DOM

Before, after the JavaScript has appended the control:

<div class="summary-wrapper">
  <label for="summary">Summary</label>
  <textarea id="summary"></textarea>
</div>
<label for="body">Body
  <span class="field-edit-link"> (<button>Edit summary</button>)</span>
</label>
<textarea id="body"></textarea>

After, with the moved and added parts highlighted:

<button type="button" aria-expanded="false" aria-controls="summary">
  Edit summary<<span class="visually-hidden"> for Body</span>
</button>
<div class="summary-wrapper" id="summary">
  <label for="summary-field">Summary<<span class="visually-hidden"> for Body</span></label>
  <textarea id="summary-field"></textarea>
</div>
<label for="body">Body</label>
<textarea id="body"></textarea>

The visible text stays “Edit summary” / “Hide summary” in parentheses. The field and item context is visually hidden. The button is before the content it controls, and it is never inside a label.

Accessible names

Before                          After
textbox "Body (Edit summary)"   button "Edit summary for Body" [expanded=false]
textbox "Summary"               textbox "Body"
                                textbox "Summary for Body"

Before, the button’s text becomes part of the Body textarea’s name, and the Summary textarea has no field context. After, the button and the summaries carry the field and item context, and the Body name no longer changes when the disclosure is used.

What to check

  1. Open Before. Tab to the disclosure and press Enter or Space. The control is replaced, focus leaves it, and the new control sits inside the Summary label.
  2. In the accessibility inspector, watch the Body textarea’s name include “Edit summary” and change after activation.
  3. Open After. Do the same. Focus stays on the same button, aria-expanded flips, and the names stay stable.
  4. The button is a native button, so Enter and Space both work without a key handler.

What this demonstration is not

Source and evidence