Question on the use of AllowTabOrderWrap in web apps for accessibility purposes

Hello! I am finally getting around to modifying my web app to be used with screenreader apps (VoiceOver on Mac and NVDA and others on Windows). I saw a post from last year regarding tab order

https://forum.xojo.com/t/tab-order-mystery-how-to-debug-2024-r4-2/84436/8

And Greg commented on this post with these two properties:

Session.AllowTabOrderWrap and WebView.AllowTabOrderWrap

First, I would like to know how to properly use these properties. Are these just set to False in the page.Opening, specifically for pages that are intended for use by screenreaders? From the docs for the WebView.AllowTabOrderWrap:

It should be set to False for webpages that will be used by users who depend on accessibility settings that allow them to tab to the browser’s toolbar controls.

The Session.AllowTabOrderWrap doesn’t provide much detail at all:

Setting this property after the Opening event will raise an UnsupportedOperationException.

My second question is, which one is preferred to use as an accessibility piece? Session or WebPage?

Lastly, is my understanding of this correct? Setting this property to False simply allows the accessible user to be able to navigate to the browser’s toolbar itself (back, refresh, URL bar)? So if this prop isn’t set to False, then that means the user is stuck in the app and cannot navigate away, which is not good?

1 Like

I got a little help from Chat on this to see what it said. Posting Chat’s reply in case anyone else is tripped up with this concept

What AllowTabOrderWrap does

AllowTabOrderWrap controls what happens when a user presses Tab on the last focusable control on a page.

If it is True:

  • Pressing Tab on the last control will move focus back to the first control.

  • Keyboard navigation loops continuously.

If it is False:

  • Pressing Tab on the last control does nothing (focus stays there).

  • The keyboard does not wrap back to the top.

Think of it like this:

Property Behavior
True Last control → wraps back to first
False Last control → stops

Session vs WebPage

You noticed correctly that it exists in two places.

Session.AllowTabOrderWrap

Global default for all pages in the session.

If you set this in Session.Opening: Session.AllowTabOrderWrap = False

then every page inherits that behavior unless overridden.


WebPage.AllowTabOrderWrap

Overrides the session setting for that specific page.

What accessibility users usually expect

For screen reader and keyboard users, the best behavior is usually:

AllowTabOrderWrap = False

Why:

If wrapping is enabled, users can get stuck in an infinite tab loop and lose awareness of where they are on the page.

Accessibility guidelines generally prefer:

  • predictable start

  • predictable end

  • no unexpected loops

Screen reader users typically use other navigation commands to jump around anyway.

1 Like