
Closing a photo lightbox should normally return keyboard focus to the thumbnail or control that opened it. If focus instead disappears or jumps to the page start, ask the implementer to review the complete modal interaction. A visually closed overlay does not show where a keyboard visitor will continue. Keep the opening control, the enlarged view and the return destination in the same acceptance test.
Key Takeaways
- Check focus when the large view opens, while it is open and after it closes.
- The usual return destination is the control that opened the dialog.
- Removed controls and deliberate workflow changes require a sensible alternative destination.
Identify the exact photo and opening control
Choose a photograph in the middle of the gallery, rather than always testing the first item. Record its visible identifier and the control that opens it. For a client proof, use the same identifiers as the revision annotation record. That lets a reviewer report a specific lost position instead of saying the gallery feels confusing.
Distinguish the enlarged interface from the underlying image address. A valid image URL does not repair focus behavior; conversely, a temporary preview address can fail sharing even when the lightbox operates correctly. Give the implementation owner the symptom that actually occurred.
Check entry and navigation inside the large view
The W3C modal dialog pattern says focus moves inside an opened dialog. Tab and Shift+Tab navigate its controls without moving into the underlying page. Escape closes it, and a visible closing control is strongly recommended. Initial focus depends on the content; the first interactive control is not automatically the best choice for every dialog.
For a proposed three-photo proof, open photo B with the keyboard. Identify the focused element, reach the close control and inspect any navigation controls. A caption with several paragraphs may need a different initial reading position from a simple enlarged photograph. Do not put a long caption into one inaccessible control name merely to make it announced. Use appropriate descriptions for images separately.
Follow the visitor through closing
Use a receiving checklist on the actual implementation:
- Reach the chosen gallery item from the preceding content.
- Open the enlarged view and identify the new focus position.
- Navigate its available controls in both directions.
- Close with the visible control and note the return destination.
- Repeat using Escape, then continue to the next gallery item.
These are proposed operations, not results observed here. Repeat from a later item and after any supported photo navigation inside the dialog. Record the photo shown, opening control and eventual return target so a developer can reproduce an unexpected jump.
The pattern allows exceptions when the opening element no longer exists or the completed task logically leads somewhere else. For example, a gallery rebuilt after an action may need a deliberate replacement target. Do not use that exception to excuse an unexplained return to the top of every page.
Approve the implemented interaction
W3C's native dialog technique describes a browser-managed modal route and a keyboard test. It distinguishes opening a dialog modally from merely displaying it. Adding an ARIA label alone does not implement the required behavior.
Ask the implementation owner to choose an appropriate supported approach, then repeat the receiving test in the browsers and assistive technology intended for the portfolio. Accept the lightbox when visitors can enter, inspect, close and continue from an understandable position. This verifies one gallery task; it does not certify the entire website.
Related tasks
- Why Does a blob: Image Link Open for Me but Not for My Client?
- Should I Use My Generation Prompt as Alt Text for an AI Image?
- How Do I Tell a Photo Editor Exactly Which Area Needs Changing?
Sources and scope
- WAI-ARIA Authoring Practices: Dialog (Modal) Pattern: Modal dialogs receive focus, contain their tab sequence, support Escape and normally return focus to the invoking element; documented workflow exceptions apply.
- W3C Technique H102: Creating modal dialogs with the HTML dialog element: The native modal dialog route provides browser-managed focus, inert outside content and return to an existing invoking element. The technique includes keyboard acceptance checks.
Documentation-based implementation review using complete supplied W3C captures, reviewed October 29, 2026. No gallery was operated. The numbered-photo scenario and receiving procedure are proposed checks, not an accessibility certification.
Prepared by Imagild Editorial, the company editorial team responsible for these guides. AI assisted research and drafting. This is documentation-based guidance with proposed examples, not a claim of hands-on testing or an independent product review. Report a correction.
Cover: AI-generated conceptual editorial illustration; not a real application screenshot, observed output or before-and-after test.