Handles edge cases for tooltip - makes sure tooltip is always into full view.
Linter fixes