mirror of
https://github.com/discourse/discourse.git
synced 2025-01-16 06:32:42 +08:00
UX: do not tab to an already active tab (#30531)
This commit is contained in:
parent
80cda1212e
commit
9b7fc3797e
|
@ -64,6 +64,11 @@ export default class MoreTopics extends Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@action
|
||||||
|
isActiveTab(tab) {
|
||||||
|
return tab?.id === this.selectedTab?.id;
|
||||||
|
}
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="more-topics__container">
|
<div class="more-topics__container">
|
||||||
{{#if (gt this.tabs.length 1)}}
|
{{#if (gt this.tabs.length 1)}}
|
||||||
|
@ -76,7 +81,8 @@ export default class MoreTopics extends Component {
|
||||||
@translatedLabel={{tab.name}}
|
@translatedLabel={{tab.name}}
|
||||||
@translatedTitle={{tab.name}}
|
@translatedTitle={{tab.name}}
|
||||||
@icon={{tab.icon}}
|
@icon={{tab.icon}}
|
||||||
class={{if (eq tab.id this.activeTab.id) "active"}}
|
class={{if (this.isActiveTab tab) "active"}}
|
||||||
|
tabindex={{if (this.isActiveTab tab) -1 0}}
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user