Skip to content

Commit

Permalink
Switch tab activation to manual
Browse files Browse the repository at this point in the history
When navigating the tab list with the arrow keys, the default behaviour
of the Carbon components is to load the tab panel corresponding with the
currently focused tab.

Since some of the tab content in the Dashboard triggers additional network
requests when rendered (e.g. step logs tab), set `activation="manual"` so
that the user must click (or press space / enter) to activate the tab.
  • Loading branch information
AlanGreene committed Jul 22, 2024
1 parent f8ad0c7 commit b515257
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const ResourceDetails = ({
onChange={event => onViewChange(tabs[event.selectedIndex])}
selectedIndex={selectedTabIndex}
>
<TabList>
<TabList activation="manual">
<Tab>
{intl.formatMessage({
id: 'dashboard.resource.overviewTab',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const StepDetails = ({
onChange={event => onViewChange(tabs[event.selectedIndex])}
selectedIndex={selectedTabIndex}
>
<TabList>
<TabList activation="manual">
<Tab>
{intl.formatMessage({
id: 'dashboard.taskRun.logs',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ const TaskRunDetails = ({
onChange={event => onViewChange(tabs[event.selectedIndex])}
selectedIndex={selectedTabIndex}
>
<TabList>{tabList}</TabList>
<TabList activation="manual">{tabList}</TabList>
<TabPanels>{tabPanels}</TabPanels>
</Tabs>
</div>
Expand Down

0 comments on commit b515257

Please sign in to comment.