Autocomplete view go past its parent right limit

When autocomplete is triggered on the rightmost part of a line, the popup doesn't snap to its parent limit and is partially cropped: 

![](http://i.imgur.com/vUNUQvd.png)

It should actually stick to the right edge, like this: 

![](http://i.imgur.com/2UWm6go.png)