Ver código fonte

make enter button work on search

Ivan Galakhov 5 anos atrás
pai
commit
e1a817ac1d

+ 5 - 0
dashboard/src/components/repo-selector/RepoList.tsx

@@ -173,6 +173,11 @@ const RepoList: React.FC<Props> = ({
                 onChange={(e: any) => {
                 onChange={(e: any) => {
                   setSearchInput(e.target.value);
                   setSearchInput(e.target.value);
                 }}
                 }}
+                onKeyPress={({ key }) => {
+                  if (key === "Enter") {
+                    setSearchFilter(searchInput);
+                  }
+                }}
                 placeholder="Search repos..."
                 placeholder="Search repos..."
               />
               />
             </SearchBar>
             </SearchBar>