From d38dcbe8a25756ac71e7fd5adca1de1485657c77 Mon Sep 17 00:00:00 2001 From: Shagen Ogandzhanian Date: Mon, 14 Jun 2021 12:24:44 +0200 Subject: [PATCH] Label content is specialized as HTMLLabelElement --- .../src/jsMain/kotlin/androidx/compose/web/elements/Base.kt | 3 ++- .../jsMain/kotlin/androidx/compose/web/elements/Elements.kt | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/web/core/src/jsMain/kotlin/androidx/compose/web/elements/Base.kt b/web/core/src/jsMain/kotlin/androidx/compose/web/elements/Base.kt index 107276c476..cd29d8c4b3 100644 --- a/web/core/src/jsMain/kotlin/androidx/compose/web/elements/Base.kt +++ b/web/core/src/jsMain/kotlin/androidx/compose/web/elements/Base.kt @@ -28,6 +28,7 @@ import org.w3c.dom.HTMLHeadingElement import org.w3c.dom.HTMLImageElement import org.w3c.dom.HTMLInputElement import org.w3c.dom.HTMLLIElement +import org.w3c.dom.HTMLLabelElement import org.w3c.dom.HTMLOListElement import org.w3c.dom.HTMLOptGroupElement import org.w3c.dom.HTMLOptionElement @@ -133,7 +134,7 @@ interface ElementBuilder { val Main: ElementBuilder = ElementBuilderImplementation("main") val Footer: ElementBuilder = ElementBuilderImplementation("footer") val Hr: ElementBuilder = ElementBuilderImplementation("hr") - val Label: ElementBuilder = ElementBuilderImplementation("label") + val Label: ElementBuilder = ElementBuilderImplementation("label") val Table: ElementBuilder = ElementBuilderImplementation("table") val Caption: ElementBuilder = ElementBuilderImplementation("caption") val Col: ElementBuilder = ElementBuilderImplementation("col") diff --git a/web/core/src/jsMain/kotlin/androidx/compose/web/elements/Elements.kt b/web/core/src/jsMain/kotlin/androidx/compose/web/elements/Elements.kt index 36353c46b8..8674469f40 100644 --- a/web/core/src/jsMain/kotlin/androidx/compose/web/elements/Elements.kt +++ b/web/core/src/jsMain/kotlin/androidx/compose/web/elements/Elements.kt @@ -27,6 +27,7 @@ import org.w3c.dom.HTMLHRElement import org.w3c.dom.HTMLImageElement import org.w3c.dom.HTMLInputElement import org.w3c.dom.HTMLLIElement +import org.w3c.dom.HTMLLabelElement import org.w3c.dom.HTMLOListElement import org.w3c.dom.HTMLOptGroupElement import org.w3c.dom.HTMLOptionElement @@ -371,9 +372,9 @@ fun Hr( fun Label( forId: String? = null, attrs: AttrBuilderContext = {}, - content: ContentBuilder? = null + content: ContentBuilder? = null ) { - TagElement( + TagElement( elementBuilder = ElementBuilder.Label, applyAttrs = { forId(forId)