Select2 with Virtual Keyboard

Is it possible to integrate select2 with a virtual keyboard? I have used so many plug-ins and I ended up encountering error as the dropdown closes by itself and the error saying “Uncaught TypeError: Cannot read property ‘selectionStart’ of undefined”

Do you have any ideas about what went wrong here?