Li Jiabao
Display: Static中文 以中文閱讀本頁

Edited by lijiabao.dev

Can a native FAQ disclosure work with a keyboard?

Check the native FAQ path from summary focus and the Space key to answer links, visible focus, and assistive technology support.

Yes. A details element with a summary provides a browser-managed disclosure, so a basic FAQ does not need a JavaScript component library just to open an answer. The remaining question is whether the finished design preserves that behaviour and makes each question understandable.

A hand near the Space key on a keyboard beside a softly focused web page

Where is the control inside a details element?

Put the question in the first summary child, followed by its answer. The HTML standard defines this as a way to reveal additional information; activating the summary changes the open state. A specific question such as “Can I change my booking time?” gives readers a useful choice before they expand anything. A repeated label such as “More” does much less.

Follow the keyboard path through one answer

MDN documents opening and closing the disclosure by focusing it and pressing Space. A useful acceptance check starts with the pointer left alone: reach the question with Tab, locate the focus indicator, activate it, then visit any answer links and return with Shift+Tab. These are proposed checks, not results from a completed cross-browser test. Although a details element supplies native interaction, record the operating system’s keyboard navigation settings, browser and assistive technology used for the actual check.

Keep the focus indicator when changing the design

An arrow can be redesigned, but the person using the keyboard still needs to see which question will respond. W3C’s Focus Visible guidance explains that purpose. If a stylesheet removes the default outline, provide a clear replacement; a hover colour alone does not identify keyboard focus. Also check that a custom icon follows the actual open state. Otherwise the answer and its visual cue may disagree.

Does a details element need custom key handlers?

Ordinary disclosure does not need a second keyboard implementation. A handler that switches open while the browser also performs its default action can interfere with that behaviour, so diagnose the actual event sequence before adding another fix. Observe toggle when the application needs to react to a state change. The details element also has a specific semantic purpose: the HTML standard distinguishes disclosure from tabs and menus. Sharing an arrow-shaped icon does not make those controls interchangeable.

Does successful toggling prove the whole FAQ is accessible?

No. MDN notes that browsers can expose summary roles differently, affecting the semantics of headings placed inside them. Check the announced name and state in the combinations your audience uses. Giving several disclosures the same name creates an exclusive group, but readers may want two answers open for comparison. The standard explicitly asks authors to consider that tradeoff. Leave independent questions open together when exclusivity has no useful purpose.

A useful handover records whether questions can be reached, focus remains visible, answers can be read and followed, and which browser and assistive technology combinations were checked. That gives the next maintainer more to work with than a screenshot of clickable rows.

Related reading: Hidden, aria-hidden and inert solve different interface problems, Image alt text and visible captions are different CMS outputs

Sources

  1. MDN: details disclosure behaviour(external site) developer.mozilla.org
  2. WHATWG HTML: details and summary(external site) html.spec.whatwg.org
  3. MDN: summary and accessibility support(external site) developer.mozilla.org
  4. W3C WAI: Focus Visible(external site) w3.org