Select to view content in your preferred language

Set focus to calcite panel when expanded

365
0
08-26-2023 07:25 AM
AnnaWilliams
Emerging Contributor

Is there a way to set focus to the calcite panel when shellpanel.collapsed = false?  For those using keyboard navigation, you can tab to the menu and hit enter to open the panel however you have to tab through the rest of the menu to reach the open panel.  See this example A Pen by msamwill (codepen.io)

Can something be added to code below to set focus to the 

//AMW this fires when opening a widget panel
const nextWidget = target.dataset.actionId;
if (nextWidget !== activeWidget) {
document.querySelector(`[data-action-id=${nextWidget}]`).active = true;
document.querySelector(`[data-panel-id=${nextWidget}]`).hidden = false;
activeWidget = nextWidget;
} else {
activeWidget = null;
}

0 Kudos
0 Replies