Tab looping cannot be set up declaratively. This functionality is meant to align with the standard tabbing behavior of the browser, which includes navigating through all tab-able elements on the page and in the browser interface.
If you wish to restrict tabbing from a specific group of elements, JavaScript will be necessary. It's important to understand why this limitation is being imposed, provide clear visual indicators that certain elements are focused over others, and consider users who rely on keyboard navigation without visuals.
If after careful consideration you decide to alter the tabbing sequence, one approach is to create hidden tabbable elements (though still displayed) positioned before and after your target form items. These elements will redirect focus back to the beginning or end of the form as needed.
preFormDummy.addEventListener('focus', function(e){
lastFormItem.focus() }, true )
postFormDummy.addEventListener('focus', function(e){
firstFormItem.focus() }, true )
Remember to initially disable these dummy elements and only enable them once the form is accessed, signalling a modal state. Disable them again once the form interaction is complete.
It is crucial to conduct user testing to gauge reactions to this adjusted tabbing behavior. Feedback will reveal if users find it helpful or unsettling due to unexpected changes in tab navigation.