Skip to content

Commit 9f03f9a

Browse files
committed
[TAC027] Improve the usability of the floating help
After the accessibility changes the floating help buttons were making the user jump in the view.
1 parent 623b262 commit 9f03f9a

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

decidim-core/app/assets/javascripts/decidim/floating_help.js.es6

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ $(function() {
2828
$(".floating-helper-container").each((_index, elem) => {
2929
let id = $(elem).data("help-id");
3030

31+
$(
32+
".floating-helper__trigger, .floating-helper__content-close",
33+
elem
34+
).on("click", (ev) => {
35+
ev.preventDefault();
36+
});
37+
3138
if (!dismissedHelpers.includes(id)) {
3239
$(".floating-helper", elem).foundation("toggle");
3340
$(".floating-helper__wrapper", elem).foundation("toggle");

decidim-core/app/views/decidim/shared/_floating_help.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<%= t ".help" %>
77
</div>
88
<div class="floating-helper__icon">
9-
<%= icon "question-mark", class: "icon--small", role: "img" %>
9+
<%= icon "question-mark", class: "icon--small", role: "img", aria_label: t(".help") %>
1010
</div>
1111
</a>
1212
</div>
@@ -16,15 +16,15 @@
1616
<div class="floating-helper__content">
1717
<div class="floating-helper__content-inner">
1818
<div class="floating-helper__icon-big show-for-medium">
19-
<%= icon "question-mark", class: "icon--large", role: "img" %>
19+
<%= icon "question-mark", class: "icon--large", role: "img", aria_label: t(".help") %>
2020
</div>
2121
<div class="mb-s">
2222
<%= content %>
2323
</div>
2424
</div>
2525
</div>
2626
<a href="#floating-helper-tip" class="floating-helper__content-close" data-toggle="floating-helper-block floating-helper-tip">
27-
<%= icon "x", class: "icon--small", role: "img" %>
27+
<%= icon "x", class: "icon--small", role: "img", aria_label: t(".close") %>
2828
</a>
2929
</div>
3030
</div>

0 commit comments

Comments
 (0)