Do you have a particular situation that you think requires that behavior?
–
Matt ObeeFeb 14 '13 at 23:12

@MattObee I was looking for a general rule of thumb.
–
AnthonyFeb 15 '13 at 14:00

2

If a user is using tab then you can assume that the user 'expects' a certain behavior. Tabbing back to the top element is not an expected behavior in any application as far as I know. It would be best to avoid this unexpected behavior since tab behavior is fairly well established. It will confuse the user to NOT see the cursor jump down in the expected progression and they'll have to break their thought process to figure out what happened.
–
Jerry SaraviaFeb 15 '13 at 15:28

Think also of screen reader users. They will probably be expecting the next focusable item after the last text input to be submit button. The unexpected shift will be confusing. In general, don't muck with the tabbing order unless you have a really good reason to.
–
steveaxFeb 16 '13 at 17:59

3 Answers
3

You should generally avoid trapping the user's keyboard focus within a sub-section of content, particularly if that sub-section is presented alongside or within the normal flow of other content. It is non-standard behaviour that a keyboard user wont be expecting, and is particularly disorientating for visually impaired users who cannot easily recognise what is happening. If a user can tab onto an object or into a sub-section, they should ideally be able to tab through and away from it.

There are exceptions for things like modal dialogs which are presented separately from other content and are designed to be interacted with as a separate context, but in those situations there should be a very clear route (such as a close button) to escape and return to the original context.

The relevant accessibility guideline in WCAG is SC 2.1.2 (No Keyboard Trap) which recommends that the user's keyboard focus should not be trapped, or if it is, it should be made very clear to the user how to escape using their keyboard. See also technique G21 which describes how to achieve this.