I need to display the items in the Filter widget dropdown menu in a specific order, but cannot find a way to do it. Esri seems to automatically sort the items in alphabetical order, which is great in most cases, but not in this case. The items needs to be sorted in the same order as they appear in the Legend and it's very important. I tried using the 'Predefine unique values' option in the Expression Builder to order the items the way I need them in the hopes that this order would be honored in the selection menu, but they are being re-ordered some place in the code.

I logged the value options from the .tsx file and they are in the correct order here.
Here is the order that they appear in the dropdown menu:

Does anyone know if I am missing something obvious, or where in the code the html for the dropdown menu is being created?