@@ -70,7 +70,7 @@ type Props = {};
7070 var tabs = Array.from(document.querySelectorAll('.install-tab'));
7171 var panels = document.querySelectorAll('.install-panel');
7272
73- function activateTab(tab) {
73+ function activateTab(tab, shouldFocus ) {
7474 tabs.forEach(function (t) {
7575 t.classList.remove('active');
7676 t.setAttribute('aria-selected', 'false');
@@ -84,7 +84,7 @@ type Props = {};
8484 tab.classList.add('active');
8585 tab.setAttribute('aria-selected', 'true');
8686 tab.setAttribute('tabindex', '0');
87- tab.focus();
87+ if (shouldFocus) tab.focus();
8888 var panelId = tab.getAttribute('aria-controls');
8989 var panel = document.getElementById(panelId);
9090 if (panel) {
@@ -97,12 +97,12 @@ type Props = {};
9797 var ua = navigator.userAgent.toLowerCase();
9898 if (ua.includes('mac') || ua.includes('linux')) {
9999 var macTab = document.getElementById('tab-macos');
100- if (macTab) activateTab(macTab);
100+ if (macTab) activateTab(macTab, false );
101101 }
102102
103103 tabs.forEach(function (tab) {
104104 tab.addEventListener('click', function () {
105- activateTab(tab);
105+ activateTab(tab, true );
106106 });
107107 });
108108
@@ -125,7 +125,7 @@ type Props = {};
125125 return;
126126 }
127127 e.preventDefault();
128- activateTab(tabs[nextIndex]);
128+ activateTab(tabs[nextIndex], true );
129129 });
130130 }
131131 }
0 commit comments