Won't fix Gallery: hides dropdown when window loses focus

Arty

Well-known member
There is an annoying issue in XenForo Media Gallery 1.0.0 when trying to upload new media at this URL: /media/add

First option is to select category with dropdown from predefined categories. Problem is its impossible to style that dropdown for custom styles because its behavior prevents dropdown from being inspected. I click dropdown and I see this:

dropdown.webp

I wanted to fix colors of "Example Category" in my style, to do that I need to find out what class it is so I could find entry in gallery css templates.

Problem is, as soon as I click on browser tools' inspection window, dropdown closes. As soon as browser window loses focus that dropdown closes.

There is no reason for dropdown to behave like that. It is not only inconsistent with the rest of XenForo scripts, but also makes it hard to debug designs. Please remove that behavior from JavaScript.
 
The current behaviour you're reporting is a behaviour in the "Chosen" library that is being used in the Gallery. It does seem to be somewhat browser dependent, though.

It doesn't do this for me in Chrome.

I can sort of see the behaviour in Firefox. The dropdown closes when I click Inspect Element, but it focuses the correct elements in the inspector, and from then on I can see and do enough to ascertain what the class names are.

It also works correctly for me in Safari, just as with Chrome.
 
Last edited:
I'll definitely look at it, but just wanted to point out the differences of behaviour depending on the browser :)
 
By the way, it is not Select2. It is "Chosen", don't know what I was thinking :)

CSS is all in xengallery_media_edit.css and prefixed with the class "chosen".
 
Unfortunately the Chosen library controls most of this behaviour, but in most of my testing it's easy enough to inspect something close to things like the drop down contents, e.g. the search/filter box.

We may look at using something other than Chosen in the future, but we'll save that for a more major update. I have updated Chosen to the latest version, though, just to ensure it's as bug free as possible.
 
Back
Top Bottom