Dynamic Dropdown on Filter popup


I have 2 dynamic dropdown menu for test (Global Regions and Regional Countries) like this post Dynamic Dropdown Creation

However there is a problem in the “Filters” mask, both Global Regions and Regional Countries appear at the same time, in practice Regional Countries does not appear dynamically compared to what you choose in Global Regions, such as can i solve?