Skip to content

A platform for community discussion. Free, open, simple.

A11Y: update clickable search dropdown tips to be buttons (#29762)

Kris5f130b29711f
diff --git a/app/assets/javascripts/discourse/app/components/search-menu/results/random-quick-tip.hbs b/app/assets/javascripts/discourse/app/components/search-menu/results/random-quick-tip.hbs
index 2a605efe836..c9da7348637 100644
--- a/app/assets/javascripts/discourse/app/components/search-menu/results/random-quick-tip.hbs
+++ b/app/assets/javascripts/discourse/app/components/search-menu/results/random-quick-tip.hbs
@@ -1,16 +1,16 @@
<li class="search-random-quick-tip">
- <span
+ <button
class={{concat-class
"tip-label"
(if this.randomTip.clickable "tip-clickable")
}}
- role="button"
{{on "click" this.tipSelected}}
+ aria-describedby="tip-description"
>
{{this.randomTip.label}}
- </span>
+ </button>
- <span class="tip-description">
+ <span id="tip-description">
{{this.randomTip.description}}
</span>
</li>
\ No newline at end of file
diff --git a/app/assets/stylesheets/common/base/search-menu.scss b/app/assets/stylesheets/common/base/search-menu.scss
index 074ee5b62ac..f4e3aa5c349 100644
--- a/app/assets/stylesheets/common/base/search-menu.scss
+++ b/app/assets/stylesheets/common/base/search-menu.scss
@@ -326,6 +326,7 @@ $search-pad-horizontal: 0.5em;
margin-right: 4px;
padding: 2px 4px;
display: inline-block;
+ border: none;
&.tip-clickable {
cursor: pointer;
}