When you change the content of the page, it's important to direct the user's attention by moving focus. A classic example of when this technique is useful is when opening a modal dialog. If a user relying on a keyboard presses a button to open a dialog and their focus is not moved into the dialog element, then their only course of action is to tab through the entire site until they eventually find the new control. By moving focus into the new content as soon as it appears, you can improve the efficiency of these users’ experiences.
A negative tabindex can be used to enable programmatic focus to the context menu's container:
It'd be a great accessibility improvement for keyboard users if focus was delegated to the context menu's container.
https://developers.google.com/web/fundamentals/accessibility/a11y-for-teams#managing_focus:
A negative
tabindex
can be used to enable programmatic focus to the context menu's container:https://webaim.org/techniques/keyboard/tabindex#zero-negative-one: