This error occurs when an element is part of a group (like a menu or button bar) or a composite widget. In these cases, elements should be focusable but not necessarily tabbable to allow for standard keyboard interaction patterns (e.g., using arrow keys to navigate).
To fix this, assign tabindex="-1" to the elements in the group. Ensure that at least one item in the group has tabindex="0" so the user can tab into the component initially. Once focus is inside, you must implement manual key handling (up/down/left/right) to move focus between the elements.
<template>
<div role="menu">
<div role="menuitem" tabindex="0">Open</div>
<div role="menuitem" tabindex="-1">Save</div>
<div role="menuitem" tabindex="-1">Close</div>
</div>
</template>