In Discourse versions before 2.8.0.beta5, if you edit a topic and click the Category select drop down, the current category is both selected and scrolled down to in the list of categories, such that it is immediately visible at the top, and its subcategories (if any) are visible. The topic can then be easily moved into a more appropriate subcategory.
Working in 2.8.0.beta4 and earlier:
As of 2.8.0.beta5, the current category is no longer scrolled to when opening the Category select drop down:
I hope these short video demos are helpful in quickly showing what Iâm trying to describe.
Note: in my examples I have the âfixed category positionsâ and " fixed category positions on create" options on, however the scroll to current behavior is missing with these options on or off.
I confirmed this in local development by installing 2.8.0.beta4 and observing the desired behavior, and then updating to 2.8.0.beta5 and observing the behavior no longer working.
I dug around in the code until I found that the following large commit involving select-kit.js is where the change took place (wait a moment and it should jump to the lines of code in question):
The following code was removed from the _scrollToRow() method, which gets called by the _scrollToCurrent() method:
if (rowContainer) {
const collectionContainer = rowContainer.parentNode;
collectionContainer.scrollTop =
rowContainer.offsetTop - collectionContainer.offsetTop;
}
I confirmed that adding this code back to select-kit.js in 2.8.0.beta5 fixes the issue, though as itâs not clear to me why it was removed, Iâm uncertain of other possible side effects of adding it back.
Thank you for taking a look at this, and I hope we can get this behavior working again in a future release.