diff options
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/dropdown')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt b/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt index 1af71dc8..0f653d30 100644 --- a/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt +++ b/src/main/kotlin/pl/treksoft/kvision/dropdown/DropDown.kt @@ -239,7 +239,7 @@ open class DropDown( internal var counter = 0 /** - * DSL builder extension function + * DSL builder extension function. * * It takes the same parameters as the constructor of the built component. */ @@ -247,8 +247,10 @@ open class DropDown( text: String, elements: List<StringPair>? = null, icon: String? = null, style: BUTTONSTYLE = BUTTONSTYLE.DEFAULT, disabled: Boolean = false, classes: Set<String> = setOf(), init: (DropDown.() -> Unit)? = null - ) { - this.add(DropDown(text, elements, icon, style, disabled, classes).apply { init?.invoke(this) }) + ): DropDown { + val dropDown = DropDown(text, elements, icon, style, disabled, classes).apply { init?.invoke(this) } + this.add(dropDown) + return dropDown } } } |