fix tooltip position

When approaching the lower end of the container also appears bug in a tooltip.

Changing the position of a tooltips is better to apply after filling the contents and change its size. In addition, we do not need the extra steps to determine the position when a tooltip is hidden. Otherwise, we can observe twitching a tooltips.