I would like to make a div element navigable by arrow keys when JAWS is running. The div should not be navigable using the TAB key; so using tabindex is not applicable.
Here is an example snippet of the html/reactjs structure.
const label1 = 'First label';
const label2 = 'Second label';
const prefix = 'Prefix';
const suffix = 'Suffix';
const screenReaderText = `${prefix} ${label1} ${suffix} ${label2}`;
return (
<>
<h1>Heading</h1>
<div className="container" aria-label={screenReaderText}>
<div aria-hidden="true">{label1}</div>
<div aria-hidden="true">{label2}</div>
</div>
<footer>Footer</footer>
</>
);
The two nested div should not be available to the accessibility API; hence the use of aria-hidden="true". The div with className="container" should be navigable by arrow keys when using JAWS. Moreover, when navigating to the container div, JAWS should read out a label which is a combined and modified text of the contents the two inner div.
The navigation flow should be: h1 -> container div -> footer
I am guessing I should apply an appropriate role to the container div. The tree role gives the desired effect, but reading about it suggests that it is not best practice for this use case.