fix(button): submit forms using fake button

fixes #14890
fixes #14786
This commit is contained in:
Manu Mtz.-Almeida
2018-07-30 18:41:32 +02:00
parent b0ed4265eb
commit c05d672703
3 changed files with 39 additions and 22 deletions

View File

@ -9,8 +9,12 @@ export function reorderArray(array: any[], indexes: {from: number, to: number}):
return array;
}
export function hasShadowDom(el: HTMLElement) {
return !!el.shadowRoot && !!el.attachShadow;
}
export function renderHiddenInput(container: HTMLElement, name: string, value: string, disabled: boolean) {
if (container.shadowRoot) {
if (hasShadowDom(container)) {
let input = container.querySelector('input.aux-input') as HTMLInputElement;
if (!input) {
input = container.ownerDocument.createElement('input');