Merge pull request #762 from iAbhishekPanwar/patch-2

Fix: Correct URL Encoding in SearchBar Component
This commit is contained in:
Timothy Z. 2024-12-19 23:05:06 +02:00 committed by GitHub
commit 3d806257df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;