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

.attach(elements) doesn't accept array of elements. #148

Closed
samkelleher opened this issue Feb 20, 2016 · 1 comment
Closed

.attach(elements) doesn't accept array of elements. #148

samkelleher opened this issue Feb 20, 2016 · 1 comment

Comments

@samkelleher
Copy link
Contributor

The documentation indicates that the attach() method accepts an 'array of DOM elements'.

However this no longer functions. Passing in an array of DOM elements does nothing. Internally I believe the array is replaced with an empty array in getWavesElements function, shown below.

var stringRepr = toString.call(nodes);

        if (stringRepr === '[object String]') {
            return $$(nodes);
        } else if (isObject(nodes) && /^\[object (HTMLCollection|NodeList|Object)\]$/.test(stringRepr) && nodes.hasOwnProperty('length')) {
            return nodes;
        } else if (isDOMNode(nodes)) {
            return [nodes];
        }
toString.call(rowItemElements);
"[object Array]"

Seen above, an array of DOM elements will not match any of the above if statements.

@fians
Copy link
Owner

fians commented Feb 21, 2016

Good point! Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants