@@ -388,6 +388,7 @@ const { copied: createCopied, copy: copyCreate } = useClipboard({ copiedDuring:
388388const copyCreateCommand = () => copyCreate (createCommand .value )
389389
390390const tablistNavigationKeys = new Set ([' ArrowRight' , ' ArrowLeft' , ' Home' , ' End' ])
391+ const activePmId = computed (() => selectedPM .value ?? packageManagers [0 ]?.id ?? ' npm' )
391392
392393function onTabListKeydown(event : KeyboardEvent ) {
393394 if (! tablistNavigationKeys .has (event .key )) return
@@ -988,7 +989,6 @@ function handleClick(event: MouseEvent) {
988989 :aria-selected =" isMounted && selectedPM === pm.id"
989990 :aria-controls =" `pm-panel-${pm.id}`"
990991 :tabindex =" isMounted && selectedPM === pm.id ? 0 : -1"
991- :data-pm-id =" pm.id"
992992 type =" button"
993993 class =" px-2 py-1.5 font-mono text-xs rounded transition-colors duration-150 border border-solid focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50 inline-flex items-center gap-1.5"
994994 :class ="
@@ -1004,12 +1004,9 @@ function handleClick(event: MouseEvent) {
10041004 </div >
10051005 </div >
10061006 <div
1007- v-for =" pm in packageManagers"
1008- :key =" pm.id"
10091007 role =" tabpanel"
1010- :id =" `pm-panel-${pm.id}`"
1011- :aria-labelledby =" `pm-tab-${pm.id}`"
1012- v-show =" selectedPM === pm.id"
1008+ :id =" `pm-panel-${activePmId}`"
1009+ :aria-labelledby =" `pm-tab-${activePmId}`"
10131010 class =" relative group"
10141011 >
10151012 <!-- Terminal-style execute command -->
@@ -1082,7 +1079,6 @@ function handleClick(event: MouseEvent) {
10821079 :aria-selected =" isMounted && selectedPM === pm.id"
10831080 :aria-controls =" `pm-panel-${pm.id}`"
10841081 :tabindex =" isMounted && selectedPM === pm.id ? 0 : -1"
1085- :data-pm-id =" pm.id"
10861082 type =" button"
10871083 class =" px-2 py-1.5 font-mono text-xs rounded transition-colors duration-150 border border-solid focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50 inline-flex items-center gap-1.5"
10881084 :class ="
@@ -1098,12 +1094,9 @@ function handleClick(event: MouseEvent) {
10981094 </div >
10991095 </div >
11001096 <div
1101- v-for =" pm in packageManagers"
1102- :key =" pm.id"
11031097 role =" tabpanel"
1104- :id =" `pm-panel-${pm.id}`"
1105- :aria-labelledby =" `pm-tab-${pm.id}`"
1106- v-show =" selectedPM === pm.id"
1098+ :id =" `pm-panel-${activePmId}`"
1099+ :aria-labelledby =" `pm-tab-${activePmId}`"
11071100 class =" relative group"
11081101 >
11091102 <!-- Terminal-style install command -->
0 commit comments