Remove use of document.getElementById since it won't work if the component is within another shadow dom component. It seems like other teams are wrapping our components in their shadow dom components so we need to be mindful of this.
The solution is to use this.el.getRootNode() and then query either the rootNode (document) or rootNode.host (shadow dom) element.
const targetForm = requestedForm
? (document.getElementsByName(`${requestedForm}`)[0] as HTMLFormElement)
: (this.el.closest("form") as HTMLFormElement);
import { getElementById, getRootNode } from "../../utils/dom";
const targetForm = rootNode instanceof ShadowRoot
? rootNode.host.querySelector(`[name=${requestedForm}]`)
: document.getElementsByName(`${requestedForm}`)[0] as HTMLFormElement
calcite-button with a form inside the shadow dom of another componentform functionality is not working as expected.Can we get this issue elevated so that we use the queryElementsRoots in dom utils?
What do you think @jcfranco Should this be a priority since it uses document and would fail inside a shadowRoot.
Added to the next sprint. Will move to this one if the queue clears up.
Think this should be pre 1.0