diff --git a/packages/compiler-dom/__tests__/transforms/validateHtmlNesting.spec.ts b/packages/compiler-dom/__tests__/transforms/validateHtmlNesting.spec.ts index 46d69846bae..af98eafd704 100644 --- a/packages/compiler-dom/__tests__/transforms/validateHtmlNesting.spec.ts +++ b/packages/compiler-dom/__tests__/transforms/validateHtmlNesting.spec.ts @@ -11,6 +11,13 @@ describe('validate html nesting', () => { expect(err!.message).toMatch(`
cannot be child of

`) }) + it("Don't warn with customize select and option", () => { + let err: CompilerError | undefined + compile(``, { onWarn: e => (err = e) }) + compile(`

`, { onWarn: e => (err = e) }) + expect(err).toBeUndefined() + }) + it('should not warn with select > hr', () => { let err: CompilerError | undefined compile(``, { diff --git a/packages/compiler-dom/src/htmlNesting.ts b/packages/compiler-dom/src/htmlNesting.ts index 5f924880bd0..8f361f84c37 100644 --- a/packages/compiler-dom/src/htmlNesting.ts +++ b/packages/compiler-dom/src/htmlNesting.ts @@ -62,8 +62,6 @@ const onlyValidChildren: Record> = { 'script', 'template', ]), - optgroup: new Set(['option']), - select: new Set(['optgroup', 'option', 'hr']), // table table: new Set(['caption', 'colgroup', 'tbody', 'tfoot', 'thead']), tr: new Set(['td', 'th']), @@ -74,7 +72,6 @@ const onlyValidChildren: Record> = { // these elements can not have any children elements script: emptySet, iframe: emptySet, - option: emptySet, textarea: emptySet, style: emptySet, title: emptySet,