🔀 Merge pull request #271 from ajnart/searchBar

 Adds query placeholder and autoFocus (#267 #268)
This commit is contained in:
Thomas Camlong
2022-06-25 15:36:06 +02:00
committed by GitHub
2 changed files with 18 additions and 2 deletions

View File

@@ -96,7 +96,13 @@ export default function SearchBar(props: any) {
} else if (isTorrent) {
window.open(`https://bitsearch.to/search?q=${query.substring(3)}`);
} else {
window.open(`${queryUrl}${values.query}`);
window.open(
`${
queryUrl.includes('%s')
? queryUrl.replace('%s', values.query)
: queryUrl + values.query
}`
);
}
}, 20);
})}
@@ -114,6 +120,7 @@ export default function SearchBar(props: any) {
onBlurCapture={() => setOpened(false)}
target={
<Autocomplete
autoFocus
variant="filled"
data={autocompleteData}
icon={icon}