Feature request: pass a HTMLElement to instantsearch container in order to support Shadow DOM #6084
Unanswered
davie-robertson
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TLDR; it does work with shadowDom, but a good web component example would be a great help
I've been looking at
autocomplete
andinstantsearch
as I am working on implementing Algolia search within a modern web-component based app (using lit-element) and therefore I need to work with shadowDom/shadowRoot.I was wondering why we don't just pass
container
as a HTMLElement rather than a string, so:would become
Then I noticed the existing getHTMLElement.js code:
so if
typeof value !=== 'string'
then we returnvalue
, which could be a HTMLElement I guess, however the library isn't rendering any of the searchbox, hits or paginations elements despite them being passed without error.I've searched for references to Algolia and shadowroot/dom and not found anything, is there some documentation that I've missed?
Edit: I found an error in my code when adding the following to the DOM
I had placed them inside a
material/web
input element by mistake, so they now render in the DOM.I still think a nice simple web component for Algolia would be a good idea. I'll share my code when I get it working in a responsive
lit
based PWABeta Was this translation helpful? Give feedback.
All reactions