I have an angular app in which there is a component that has div style as button and clicking it open or close another list of div.
I need to make this app accessible. I can handle enter with angular (keyup.enter) event , when list of divs is opened , I want to move focus to first item in that list. Currently I need to press tab to move focus when list is opened.
Is there any way to move focus automatically with using ARIA-roles . I don not want to write javascript to handle key down/up and focus shifting code.
Also is it ok to use angular (keyup.enter) for both windows and mac machines event instead of writing keydown handler in angualar typescript and matching key code.
This is dummy code for reference
<div>
<div role="button" tabindex="0">
</div>
<div *ngIf="showList" role="list">
<div role="listitem" tabindex="0">
</div>
<div role="listitem" tabindex="0">
</div>
</div>
</div>
Tried using aria roles menu, menuitem but could not move focus and could not navigate using arrow keys in list