The gif below demonstrate my issue. The autocomplete inside the onchange attribute does not show up. When I press tab, the caret/cursor just exits the {} brackets. But the autocomplete does show up only after I exit and go back inside the {} brackets.

How to fix this?