Working on a small Tooltip component. Running into an issue where the tooltip on mobile goes outside the screen and gets cut off. I'm wondering if there's a way to detect that and then use that info to switch the direction so it's not cut off.
Here's an example of what i'm dealing with 
Some more details - Tooltip component wraps around a word in a 'p' tag and add tooltip on click.