rusackas commented on code in PR #39068:
URL: https://github.com/apache/superset/pull/39068#discussion_r3592667700


##########
superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx:
##########
@@ -270,6 +280,8 @@ const AsyncSelect = forwardRef(
           }
           return previousState;
         });
+        setInputValue('');
+        setSelectOptions(prev => prev.sort(sortComparatorForNoSearch));

Review Comment:
   Scratch that, I reverted the fix. The in-place sort turns out to be 
load-bearing: it re-sorts the stored options for the next open without 
triggering a re-render, so the dropdown doesn't reorder while the menu is still 
open. The `deselects an item in multiple mode` test pins exactly that (selected 
options only rank to the top after the menu closes). Sorting a copy reorders on 
the spot and breaks it. So this one needs a bit more care to satisfy the 
immutability concern without changing that behavior. Leaving it to you 
@massucattoj, sorry for the noise!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to