Is there a way to manage the select2 component programmatically without using jQuery? I need to execute this code through Selenium, and since I cannot access the jQuery object (as it's bundled with Webpack), I have to control it using pure JS.
I attempted to simulate a user click like this:
document.getElementById('select2').click()
However, the dropdown does not open. My goal is to:
- Open the Select2 dropdown
- Type something in the search box to trigger an ajax call and display possible options
- Select an option by its text