-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop down menus will Break if their are less than six elements #8035
Comments
I found this was because the browser send too many Reference: But I've no idea about why this happend, anybody can explain this?
|
Also noticed this issue today after updating to the latest version in master and attempting to create a new Asset Model - I do have more than 6 items in a drop-down. This issue can be repro'd on the SnipeIT Demo site as well |
I reverted back to an older version of all.js and it fixed the problem - it seems like the issue comes from select2. The existing scroll callback works fine while the new one fails with the loop described above. I was able to short-cut this problem by hack fixing all.js from
to
I hope this makes sense - I'm certainly not a JS dev as you can probably tell :) Update: Pull down latest from master - this issue is now fixed. |
it works! thank u! |
Looks like snipe has noted the select2 fix on #7997 so it must be in-flight :) |
Hello, Exact same issue here with 405 method not allowed errors. Waiting for the fix. |
The all.js edit workaround works for me too. |
I've also edited the all.js file. However, it doesn't seem to be working in my environment. To be clear, we are talking about the all.js file in the ./public/js/build directory right? Or do I need for each dropdown menu at least six items? EDIT: I've changed the API limit from 120 to 500, so now I can edit and add a little bit more. |
Hello ardvw, you need to edit the all.js under the "dist" sub-container" if I remember well. Cheers, |
Same here also running into the empty drop down issue. The all.js seems compressed (no newlines, etc), so had a hard time implementing the workaround. Any recommendations on how to patch this? |
This would not be causing "method not allowed" issues. I'm legit a little baffled why our hosted customers aren't seeing this. |
I'm still unable to reproduce this on the demo, but I definitely appreciate all the sleuthing here. I'm trying to see if bumping up our select2 library might help, but since I can't reproduce it, it makes it hard to tell. :-/ |
Looks like select2 hasn't released anything new recently, so their latest is the same version we're running. :( We can't edit those libraries manually or they'll just get overwritten next time we update things. Looks like this bit of select2 might be what's causing the issue: select2/select2@d926025#diff-6bfa161cfa52b7188ae7e42328aaadbe
|
That's so weird that the issue is no reproducible 😮 ; I just tried again in Demo on two browsers (no add-ins enabled) and could trigger it when attempting to create a new asset, selecting the model drop-down and scrolling to the bottom of the list (if dev tools are open you'll see a ton of requests). |
Unfortunately if I try to downgrade select2 from before that patch I referenced above, we'll lose the accessibility fixes that were added afterwards. I need to figure out how best to approach this. Has anyone posted an issue on the select2 GH issues about this? |
I didn't raise an issue, sorry - I'm not a competent front-end dev and don't think I can explain the issue very well 😂 |
I'm going to tag in @uberbrady here to see if he can maybe offer a PR to select2, or find another workaround. |
Well, the good news (ugh, sort of?) is that we're starting to see reports of this from a handful of customers as well, which gives us a little more to work with. |
Okay, I can see what's going on here. Snipe-IT is correctly returning Furthermore, if you were to have around 117 pages of results (the number where it broke for me during my testing), the front-end JS code should be more resilient to HTTP errors such as these - I was thinking about maybe implementing some kind of exponential back-off. The Select2 list slowing down a little bit is much better than it completely breaking. I'll dig further into the documentation for Select2 and update this issue with my plan(s) of attack. |
Nope, it's not them - it's us. We use a pagination: {
more: "true" //(params.page < data.page_count)
} It's funny, I actually just noticed that @dmeltzer had noticed this too and also found it curious - I think he was right :) So we're actually using the JS to transform the correct result into an incorrectly-infinite-scrolling result. I'll dig around in the git history to see why we decided to do that. But I suspect that's where the problem lies. Another thing I was thinking - this is a little bit of added complexity that we could probably just remove entirely - e.g. we could get rid of the |
There's a PR up against Master for these changes now - feel free to give it a try and let us know if it works for you. |
(The PR is located here: #8227 ) |
I've merged that PR into master and it looks good - can anyone else confirm that this has resolved the issue? |
Just pulled master down as well - looks good to me too! |
Great - I'll close out this issue for now then. Thanks again everyone for the great sleuthing, and thanks to @uberbrady for a quick fix. |
Please confirm you have done the following before posting your bug report:
Describe the bug
Drop-down menus will display items for a period of time until it shows "The results could not be Loaded". This will prevent all drop down menus from work for a short period of time.
To Reproduce
Steps to reproduce the behavior:
Screenshots
Server (please complete the following information):
Desktop (please complete the following information):
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: