How to disable new lines in QueryField?

I’m want to prevent Enter key from creating a new line and to run the query after pressing Enter key in my Grafana plugin’s QueryField. Is this possible with QueryField or is there a better way to achieve this?