Minor Main Editor Bug With Search Bar

desukarhu

Member
Hey,

As mentioned on discord if I scroll down the list of ItemDefinitions in the main editor and use try to use the search bar the list shows irrelevant items. But if the scrollbar is at the top the search works just fine. Just a small bug, but can be a bit annoying.

Here's a video of the bug:

In the video when the "Grilled Redeye Salmon" disappears it's because I tried to scroll with my scroll wheel.

Unity 2021.1.28f1 and UIS 1.2.2.
 
It only happens in UIS 2021.1 and and 2021.2. Before that it seems to work fine.
I looked into it in depth but couldn't figure out why it wasn't working. so I just decided to move the scroll view up before filtering/sorting.
Here is the the Change in the SearchableList.cs script.

Code:
/// <summary>
/// Refresh but also select the object that was selected before the search sort.
/// </summary>
/// <param name="searchString">The search text.</param>
private void SearchSortRefresh(string searchString)
{
    m_ReorderableList.ScrollView.scrollOffset = Vector2.zero;
    
    ....

It seems to work fine. If you encounter other issues do let us know, we won't make an update for awhile unless a major problem comes up.
 
It only happens in UIS 2021.1 and and 2021.2. Before that it seems to work fine.
I looked into it in depth but couldn't figure out why it wasn't working. so I just decided to move the scroll view up before filtering/sorting.
Here is the the Change in the SearchableList.cs script.

Code:
/// <summary>
/// Refresh but also select the object that was selected before the search sort.
/// </summary>
/// <param name="searchString">The search text.</param>
private void SearchSortRefresh(string searchString)
{
    m_ReorderableList.ScrollView.scrollOffset = Vector2.zero;
   
    ....

It seems to work fine. If you encounter other issues do let us know, we won't make an update for awhile unless a major problem comes up.
Thanks! That's a perfectly fine solution, there's no need to maintain the scroll position I believe, don't think it harms the UX at all.
 
Top