mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
Fix: Correct URL Encoding in SearchBar Component
Changes Made: Used encodeURIComponent in the SearchBar component to ensure special characters and spaces in search queries are correctly encoded. Example: Before: Searching Alexa & Katie could break the query, returning incomplete results. After: The query is now encoded as Alexa%20%26%20Katie, ensuring accurate results.
This commit is contained in:
parent
659c3c96d2
commit
082df3a253
1 changed files with 1 additions and 1 deletions
|
|
@ -61,7 +61,7 @@ const SearchBar = React.memo(({ className, query, active }) => {
|
|||
|
||||
const queryInputOnSubmit = React.useCallback((event) => {
|
||||
event.preventDefault();
|
||||
const searchValue = `/search?search=${event.target.value}`;
|
||||
const searchValue = `/search?search=${encodeURIComponent(event.target.value)}`;
|
||||
setCurrentQuery(searchValue);
|
||||
if (searchInputRef.current && searchValue) {
|
||||
window.location.hash = searchValue;
|
||||
|
|
|
|||
Loading…
Reference in a new issue