'Populate Select2 field with another Select2 field in elementor

I have a field where I get available post types, and I'd like my second select2 to be populated with taxonomies from the first select2.

I have a function written for both, but trying to get the data from "post_type" is proving tricky.

The below is causing an ajax loading issue in the page builder.

I've searched high and low but haven't found a solution.

Thanks in advance.

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source