Skip to content

attachTo is not working when passing a string #122

@menor

Description

@menor

First of all, thanks for the awesome work on the library.

And now the issue:

The documentation specifies that we need to pass a string to the attachTo key
image

But this wasn't working for me, I had to pass an object like this
attachTo: {element: '.add', on: true}
To make it work, I think this is related to the parsePosition method that returns null if the str argument is not an object with an element and on keys.

function parsePosition(str) {
  if (isObjectLoose(str)) {
    if (str.hasOwnProperty("element") && str.hasOwnProperty("on")) {
      return str;
    }
    return null;
  }

Didn't made a pull request cause I don't know if is a matter of fixing the code or the documentation. But creating this issue for reference.

I'm passing the attachment positions as tether options, maybe that has also something to be with the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions