Skip to content

Constraints together fail if attachment = targetAtachment  #76

Description

@dryoma

Hi.

When the element is positioned like "inside" a target, i.e. when attachment is the same as targetAttachment, Tether seems to fail flipping the elements

I expected this configuration

new Tether({
    element: '.element',
    target: '.target',
    attachment: 'top left',
    targetAttachment: 'top left',
    constraints: [{
        to: 'window',
        attachment: 'together'
    }]
});

on this page to:

  • attach the top right corner of the element to the top right corner of the target, since with default top left-top left the element goes beyond the window borders; instead it sticks to the default top left no matter what;
  • on vertical scroll Tether behaves really odd: it flips top left-top left to bottom left-bottom left so that the element goes out of sight long before it should.

I should mention that the example is a modified examples/testbed/index.html from the repository. There at least horizontal flipping works while the vertical one fails the same way. Didn't study the code, but it might have something to do with the sizes of the target and the element.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions