Skip to content
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

Allow tooltips to receive a "bounding box" element for calculating the tooltip position near edges #249

Closed
bjoernm opened this issue Mar 7, 2016 · 3 comments
Labels
Milestone

Comments

@bjoernm
Copy link

bjoernm commented Mar 7, 2016

Currently, window is being used to get the boundaries for calculating the correct position of tooltips near the window edges. For example, instead of hiding part of tooltips when they would be rendered outside the window, they are placed correctly inside.

However, there are some cases when you want to set different boundaries than window. Would if be possible for tooltip.js to take an argument that acts as the "bounding box" instead of window?

An example for the current calculation I am talking about can be seen here.

@marijnh marijnh added the starter label Mar 7, 2016
@marijnh
Copy link
Member

marijnh commented Mar 8, 2016

That would make sense. To keep call to open convenient, it might make sense to specify a box-retrieving callback to the constructor of Tooltip. You could make the second argument be either a string or an options object, in which case the direction is taken from options.direction, and a boundingBox option is also recognized, stored in the object, and later consulted when determining the space in which the tooltip may appear. Want to submit such a PR?

@kiejo
Copy link
Contributor

kiejo commented Mar 9, 2016

I think I'll have a go at this one.

@marijnh
Copy link
Member

marijnh commented Mar 9, 2016

Fixed via #258

@marijnh marijnh closed this as completed Mar 9, 2016
@ericandrewlewis ericandrewlewis added this to the 0.5.0 milestone Mar 9, 2016
kiejo added a commit to kiejo/prosemirror that referenced this issue Mar 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants