-
Notifications
You must be signed in to change notification settings - Fork 210
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
Horizonal overflow with drop #16
Comments
Is there a workaround for this issue? |
Would love to use this lib if it supports responsive design. |
Bumping this; starting to use Drop and would love to use it more, but the constrainToWindow only seems to work for vertical positioning; horizontal simply overflows. |
As a first step, I made some changes to drop and tether. Here's the same jsFiddle from above, with my updated drop.js file used. It keeps the default arrows and just forces the tooltip content to be constrained to the window. This can and should be improved so that the arrow is pointing to its target correctly imo. In order to accomplish this, I introduced a new option to tether: Drop, by default, should set |
@markalfred That's awesome! Would you mind creating a PR with your changes to possibly get these changes into the project? Would love to iterate on your contributions as this is definitely an issues we've run into as well (and clearly many others) 😸 |
@geekjuice I've been playing with other potential solutions. For our project, we decided to patch drop so that a center-attached element could change to a left- or right-attached in order to keep it in the viewport. Which solution do you feel is more in line with the goals of the project? Example: |
I think that this is what most people (including myself) would expect to happen unless specified otherwise. This is really awesome though and I'd love to see how you are accomplishing this. Ideally, it would be nice to offer both solutions via some options, but if I had to choose one, definitely the latter. 👍 🎉 |
👍 It's via a tether patch here. The example above uses these custom options: tetherOptions:
attachment: 'top center'
targetAttachment: 'middle center'
constraints: [
to: 'window'
attachment: 'together element'
] But I can explore bubbling these settings up to drop itself. |
Ah if it's through |
I'd prefer the latter solution as well, as the first solution could lead to the arrow no longer pointing to the target correctly. I vote for including the patch of markalfred in Tether. @markalfred As tether is no longer CoffeeScript based, maybe you could redo your patch to fit the current Tether version? That'd be awesome :-) |
@markalfred: I'm also interested in your auto-positioning patch. See #100. |
+1 Is there any news on this matter? Horizontal auto positioning would be great! |
I stumbled upon this problem as well and is currently using this workaround until it's fixed in the project:
I tried version 1.2.0 of Tether - which includes a fix for horizontal positioning - but couldn't get it to work. |
Did anyone have any luck with @streamside's code? It's not working for me, but I definitely could be doing something wrong. Edit: Woops! Silliness on my part, thanks streamside - works great! Edit: It turns out that it's a bit hit and miss. See my comment here for a better solution. |
@streamside code help me a lot. Thank you. |
In case it's helpful to anyone, here's my iteration on @streamside's function to support center position
|
A wide drop will overflow horizontally, making part of the drop invisible. This appears to be as-designed. Here is a jsFiddle illustrating the issue.
It would be really nice, if it is possible, if there were a way for a drop to re-position itself horizontally as it overflows.
The easiest end-user workaround is to add
tetherOptions.constraints
like this:Here is a jsFiddle
Thanks to the brilliant design of
tether
, this works quite well. The only issue, as you can see from the latter jsFiddle, is that the arrow that points to thetarget
is missing.So really, what we're talking about here is the little arrow thingy. It's a small thing, but to some it's important, so I thought I'd mention it. :)
Cheers.
The text was updated successfully, but these errors were encountered: