Closed khaled5321 closed 1 month ago
I found the issue. It is coming from here
const getQueryParams = (searchString) => {
console.log(window.location.search)
const queryParams = window.location.search
.replace("?", "")
.split("&")
.map((param) => param.split("="))
.reduce((values, [key, value]) => {
if (key == "q") {
values[key] = searchString;
} else {
values[key] = value;
}
return values;
}, {});
const result = Object.entries(queryParams)
.map(([key, value]) => `${key}=${value}`)
.join("&");
return `?${result}`;
};
window.location.search
returns an empty string
I'm trying to replicate this issue on local but I'm not sure how to proceed. I opened admin page with search and other filters in mobile resolution but I don't see any errors in console. Do you some more information which can help me?
What information can I provide to help you?
I installed Unfold from GitHub using pip install https://github.com/unfoldadmin/django-unfold/archive/main.zip
and followed the installation and configuration instructions.
I need to be able to replicate the issue. On Firefox, in mobile resolution I don't have any console errors. Maybe you can tell which browser are you using? Which operating system? Are you able to replicate the issue only on physical mobile device or is it possible to have it on desktop as well?
It also happens on desktop. I am using chrome and Windows 11. Also, the console error doesn't always show up, the main issue is that the search is not working at all.
Please create a new repository with the minimal example where I can see an error.
Here is the repo link: https://github.com/khaled5321/test-unfold-bug
The same issue is mentioned here: https://github.com/unfoldadmin/django-unfold/issues/556#issuecomment-2222375899
Would you mind to test main branch again? I merged two PRs addressing filter issues.
I tested it. It is working now. Thank you!
Hey there, I'm having trouble with the search bar on the model page when using my mobile. It's not working, but it works fine on my laptop (EDIT: it's not working at all now). I am downloading the package directly from Github.
I checked the server logs and saw that when I try to search, it sends "undefined" in the query parameter, like this:
/admin/accounts/user/?=undefined
I also found an error in the browser console, I don't know if they are related, but I attached it just in case: