-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to center tooltip? #10
Labels
Comments
I guess you mean you want the tooltip centered in relation to the selected area, not close to the final end of the selection. No, at this moment there's no such option. It might be worth considering, although you can set the position of the popover as you want by defining a callback for the shareThis({
onOpen(popover) {
popover.style.right = "";
popover.style.maxWidth = "none";
const range = getSelection().getRangeAt(0);
const rect = range.getBoundingClientRect();
for (const prop of [ "top", "left", "width", "height" ]) {
popover.style[prop] = rect[prop] + "px";
}
}
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there any option by any chance to center tooltip?
If you look closely to Medium, they have it.
The text was updated successfully, but these errors were encountered: