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

Allow to use DocumentFragment as content value #739

Closed
sqal opened this issue Mar 18, 2020 · 1 comment
Closed

Allow to use DocumentFragment as content value #739

sqal opened this issue Mar 18, 2020 · 1 comment

Comments

@sqal
Copy link

sqal commented Mar 18, 2020

Problem

const content = document.createDocumentFragment();

// ... create some template
//  content.appendChild(item1)
//  content.appendChild(item2)

tippy.setContent(content)

Right now it's only possible to use string or HTMLElement as content value. Setting DocumentFragment as content doesn't work and we'll see [object DocumentFragment] instead of our HTML template.

Solution

Current solution is to wrap our content in div element instead of fragment.

@atomiks
Copy link
Owner

atomiks commented Mar 18, 2020

What's wrong with using a wrapping div tag? Generally fragments are useful to keep markup correct but in this context it doesn't matter, since the parent is just a div.

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

No branches or pull requests

2 participants