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

Should flipping flip the offsets too? #106

Open
dandv opened this issue Jul 21, 2015 · 8 comments
Open

Should flipping flip the offsets too? #106

dandv opened this issue Jul 21, 2015 · 8 comments
Labels

Comments

@dandv
Copy link
Contributor

dandv commented Jul 21, 2015

In this configuration, what should happen to the offset if the tether is flipped?

  targetAttachment: 'bottom right',
  targetOffset: '16px 0',
  constraints: [{
    to: 'window',
    attachment: 'together',
  }]

Here's a CodePen demonstrating the issue. I would expect the vertical offset to flip as well, but instead it remains constant:

flip should flip the offsets too

Flipping the offset would be useful if the offset is used to allow for an arrow - the arrow will be flipped, and it needs the space provided by the offset:

flip should flip the offsets too - use case

@adamschwartz
Copy link
Contributor

👍

@woble
Copy link

woble commented Jul 23, 2015

I agree that tether should handle the flipping of the offset values when the tethered object flips.

Current solution is to avoid using tether offset and use CSS instead.

// LESSCSS
@element-offset: 10px;

.element {    
    &.tether-target-attached-top {
        &.tether-element-attached-bottom {
            margin-top: -@element-offset;
        }
    }

    &.tether-target-attached-bottom {
        &.tether-element-attached-top {
            margin-top: @element-offset;
        }
    }
}

@ghost
Copy link

ghost commented Aug 7, 2015

A possible solution without breaking current implementations would be to add relativeOffset and absoluteOffset

@bionicbrian
Copy link

👍

1 similar comment
@ghempton
Copy link

ghempton commented Mar 4, 2016

👍

@miljan-aleksic
Copy link

Its also possible to update the Tether offset on the fly and reposition manually. Checking the classes you can now where is positioned, top or bottom, and set the offset as negative or positive accordingly.

A more efficient way would be appreacited, though. Wondering why there is no interest in mantaining this project.

@jonex2
Copy link

jonex2 commented Nov 10, 2016

@woble CSS solution: problem is here that tether triggers the flip wrong and the element is cropped before it flips.

@sergeylaptev
Copy link

CSS might be good, but I have no idea how to handle case when we have percentage value like this: targetOffset: '50% 0'

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

9 participants