---
title: "Place focus predictably after removing a list item"
description: "Verify deleting a disposable item leaves a meaningful visible list state and a separately checked keyboard focus destination for continued work."
canonical_url: "https://vostride.com/agent-library/accessibility-flows/focus-after-item-removal.md"
md_url: "https://vostride.com/agent-library/accessibility-flows/focus-after-item-removal.md"
content_kind: "recipe"
topic: "accessibility-flows"
---

# Place focus predictably after removing a list item

Verify deleting a disposable item leaves a meaningful visible list state and a separately checked keyboard focus destination for continued work.

## Risk

When the focused delete control disappears, focus can fall back to the document body or remain on a removed element. The expected next target must be defined for both middle-item and final-item deletion.

## Fixtures

- A test bookmark list contains Alpha link, Beta link, and Gamma link in fixed order, with deletion confined to these disposable items.
- The design contract moves focus to the next row after deleting a middle row and to Add bookmark after deleting the last remaining row.
- A prepared keyboard audit records focused elements through the confirmation and deletion lifecycle.

## Steps

1. Open the bookmark list and verify all three fixture rows are present in their expected order.
2. Use the normal delete flow for Beta link and verify the remaining list contains Alpha and Gamma only.
3. Run the separate focus check and verify the focus destination is Gamma under the stated middle-row contract.
4. Remove the remaining test rows through the same guarded flow and verify the empty-state message and Add bookmark action appear.
5. Use the independent keyboard trace to verify focus reaches Add bookmark after the final deletion and activate it to confirm the next workflow is reachable.

## Expected results

- Only the intended disposable bookmarks are removed and the empty state appears after the last one.
- Independent keyboard evidence confirms predictable focus after the middle and final deletion cases.
- The final Add bookmark action is usable; semantic announcement of removal must be checked separately if required by the product accessibility contract.

## False-pass traps

- A visible Gamma row does not prove focus moved to it after Beta disappeared.
- Clicking Add bookmark manually can conceal lost keyboard focus unless the independent trace is inspected.

## Cleanup

- Close the empty add form and remove any accidental bookmark draft created during the final reachability check.

## Use with agent-qa

Adapt this test design to your application's acceptance criteria and configured target using the [recipe execution guide](/agent-library/software-factory/turn-a-recipe-into-an-agent-qa-test.md). External fixture setup and non-UI checks require your own supported hooks or test tooling. Validate the authored test, execute it, and inspect the completed evidence; this recipe is not a recorded test result.

## References

- [agent-qa test](/docs/agent-qa/configuration/test.md)
- [agent-qa first test](/docs/agent-qa/guides/first-test.md)
- [agent-qa web testing](/docs/agent-qa/guides/web-testing.md)

- [Accessibility workflow QA recipes](/agent-library/accessibility-flows.md)
- [Software factory QA library](/agent-library.md)
