@@ -197,10 +200,10 @@ function TabNav({ tab, active, tabKind }: { tab?: Tab; active: boolean; tabKind?
/>
)}
- {useObservable(tab?.tabTitle || getReactTabTitle())}
+ {tabTitle}
-
+
@@ -208,22 +211,31 @@ function TabNav({ tab, active, tabKind }: { tab?: Tab; active: boolean; tabKind?
);
}
+const onKeyPressReactTabClose = (e: KeyboardEvent, tabKind: ReactTabKind): void => {
+ if (e.key === "Enter" || e.code === "Space") {
+ useTabs.getState().closeReactTab(tabKind);
+ e.stopPropagation();
+ }
+};
+
const CloseButton = ({
tab,
active,
hovering,
tabKind,
+ ariaLabel,
}: {
tab: Tab;
active: boolean;
hovering: boolean;
tabKind?: ReactTabKind;
+ ariaLabel: string;
}) => (