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

appendTarget hiding/selecting issues for shadowdom #1390

Open
3 tasks done
lublak opened this issue Oct 17, 2024 · 4 comments
Open
3 tasks done

appendTarget hiding/selecting issues for shadowdom #1390

lublak opened this issue Oct 17, 2024 · 4 comments

Comments

@lublak
Copy link

lublak commented Oct 17, 2024

Prerequisites

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

💥 Demo Page

I can do it in some days, i need some time to build a simple lit element for this.

Explanation

  • What is the expected behavior?

There are a lot of document.body checks in the code which doesn't work in shadowdom. It should be the appendTarget element:

https://github.com/yairEO/tagify/blob/master/src/parts/dropdown.js#L155
https://github.com/yairEO/tagify/blob/master/src/parts/dropdown.js#L218

  • What is happening instead?

Checking in the document.body instead of appendTarget

  • What error message are you getting?

A lot of glitches.

@lublak
Copy link
Author

lublak commented Oct 22, 2024

I think to support shadow dom, we need an option for "document".
There is a lot of "document". For usage in a shadow it sould be the current shadowroot.

// default:
new Tagify(
/* ...., */
{
  root: document
}
)

new Tagify(
/* ...., */
{
  root: this.shadowRoot
}
)

@yairEO
Copy link
Owner

yairEO commented Oct 23, 2024

what do you need shadowdom for?

@lublak
Copy link
Author

lublak commented Oct 24, 2024

@yairEO
I mostly use web components to develop internal applications. To use tagify In a custom web component. It should not depend on document.body. (it doesn't work with document.body.contains).

@yairEO
Copy link
Owner

yairEO commented Oct 25, 2024

Can/will you make a pull-request?

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