File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
scaladoc-js/src/searchbar Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -165,10 +165,13 @@ class SearchbarComponent(val callback: (String) => List[PageEntry]):
165
165
166
166
private def handleGlobalKeyDown (e : KeyboardEvent ) = {
167
167
// if the user presses the "S" key while not focused on an input, open the search
168
- if (e.key == " s" ) {
168
+ if (e.key == " s" || e.key == " / " ) {
169
169
val tag = e.target.asInstanceOf [html.Element ].tagName
170
170
if (tag != " INPUT" && tag != " TEXTAREA" ) {
171
171
if (! document.body.contains(rootDiv)) {
172
+ // Firefox's "quick find" uses "/" as a trigger; prevent that.
173
+ e.preventDefault()
174
+
172
175
document.body.appendChild(rootDiv)
173
176
// if we focus during the event handler, the `s` gets typed into the input
174
177
window.setTimeout(() => input.focus(), 1.0 )
You can’t perform that action at this time.
0 commit comments