DEV: Use button for sidebar section header

Buttons can be focused and action triggered via the enter key compared
to a span.
This commit is contained in:
Alan Guo Xiang Tan
2022-08-18 20:14:44 +08:00
parent 21d5904d7c
commit 2d1e50911b
3 changed files with 12 additions and 12 deletions

View File

@@ -1,12 +1,11 @@
{{#if @collapsable}}
<span
role="button"
title={{i18n "sidebar.toggle_section"}}
class="sidebar-section-header sidebar-section-header-collapsable"
{{on "click" @toggleSectionDisplay}}
>
<DButton
@title="sidebar.toggle_section"
@class="sidebar-section-header sidebar-section-header-collapsable btn-flat"
@action={{@toggleSectionDisplay}} >
{{yield}}
</span>
</DButton>
{{else}}
<span class="sidebar-section-header" title={{i18n "sidebar.toggle_section"}}>
{{yield}}

View File

@@ -202,7 +202,7 @@ acceptance("Sidebar - Plugin API", function (needs) {
assert.strictEqual(
query(
".sidebar-section-test-chat-channels .sidebar-section-header"
".sidebar-section-test-chat-channels .sidebar-section-header-text"
).textContent.trim(),
"chat channels text",
"displays header with correct text"
@@ -381,7 +381,7 @@ acceptance("Sidebar - Plugin API", function (needs) {
assert.strictEqual(
query(
".sidebar-section-test-chat-channels .sidebar-section-header"
".sidebar-section-test-chat-channels .sidebar-section-header-text"
).textContent.trim(),
"chat channels text",
"displays header with correct text"