prevent the autocomplete dropdown to go beyond the screen width

When using this library on a mobile phone, the autocomplete dropdown will expand out of the screen width when the user is typing towards the right of the textarea. With this fix, the dropdown will appear aligned to the right of the caret.