Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

[FunctionSearch] holding arrow down or arrow up (firefox) #2527

Description

@jasonLaster

In Firefox, pressing arrow down and arrow up in the function result list iterates through the list nicely.

Holding either the arrow up or down key down for long creates an undesirable affect where the list becomes increasingly janky.

It would be nice to explore workarounds to help with this issue a bit.

diff --git a/src/components/Editor/SearchBar.js b/src/components/Editor/SearchBar.js
index 7a4c581..1eeccbe 100644
--- a/src/components/Editor/SearchBar.js
+++ b/src/components/Editor/SearchBar.js
@@ -147,6 +147,7 @@ const SearchBar = React.createClass({
     }

     if (this.refs.resultList && this.refs.resultList.refs) {
+      // I think this is where we scroll
       scrollList(this.refs.resultList.refs, this.state.selectedResultIndex);
     }

@@ -410,6 +411,9 @@ const SearchBar = React.createClass({
         line: item.location.start.line,
       });

+      // clear the search ?!?!
+      this.clearSearch();
+
       this.closeSearch(e);
     }
   },
diff --git a/src/utils/result-list.js b/src/utils/result-list.js
index 4afc7c0..4f3ac6f 100644
--- a/src/utils/result-list.js
+++ b/src/utils/result-list.js
@@ -3,6 +3,7 @@ const { isFirefox } = require("devtools-config");
 function scrollList(resultList, index) {
   const resultEl = resultList[index];

+  // here's where we scroll in firefox
   if (isFirefox()) {
     resultEl.scrollIntoView({ block: "end", behavior: "smooth" });
   } else {

GIF

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Jira

    None yet

    Severity

    None yet

    Estimate

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions