Trying to build a tooltip component. When the tooltip moves away from the viewport need to switch the tooltip position that is working fine . But when the tooltip is away fr