We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 89a6409 commit 55b2a40Copy full SHA for 55b2a40
scaladoc-js/src/searchbar/SearchbarComponent.scala
@@ -165,10 +165,13 @@ class SearchbarComponent(val callback: (String) => List[PageEntry]):
165
166
private def handleGlobalKeyDown(e: KeyboardEvent) = {
167
// if the user presses the "S" key while not focused on an input, open the search
168
- if (e.key == "s") {
+ if (e.key == "s" || e.key == "/") {
169
val tag = e.target.asInstanceOf[html.Element].tagName
170
if (tag != "INPUT" && tag != "TEXTAREA") {
171
if (!document.body.contains(rootDiv)) {
172
+ // Firefox's "quick find" uses "/" as a trigger; prevent that.
173
+ e.preventDefault()
174
+
175
document.body.appendChild(rootDiv)
176
// if we focus during the event handler, the `s` gets typed into the input
177
window.setTimeout(() => input.focus(), 1.0)
0 commit comments