For accessibility I'm attempting to allow arrow keys to control the camera orbit of my model viewer the moment the poster is dismissed. So far it seems that I'm able to control the camera with the arrow keys, but only if I interact with the model-viewer a second time (i.e. I click to dismiss the poster, then can't manipulate the camera until I click the 3D model at least once). This is bad form for accessibility.
Is there a way to force model viewer to accept keyboard input without needing to click/touch the 3D model at least once? So far I've tried:
- Using the
focus();
function on my model-viewer element, on my.userInput
div within it, and the canvas element within that - Setting the tab indexes of each of these to 1 with no success
- Using
delegateFocus
on my elements - Using the
enableInteraction();
function native to model-viewer - Adding an event listener when the poster is dismissed, via
this.addEventListener('keydown', this[$modelViewer].value?.onKeyDown);
I've verified that these elements are being manipulated/appended in the correct way, so it appears using focus and tab indexes isn't what allows model-viewer to take keyboard input in the first place.
How can I force model-viewer to accept keyboard input the moment the poster is dismissed and the 3D model is loaded?