mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-11-26 20:18:49 +00:00
now StandardInput uses callback with input receiver
This commit is contained in:
parent
6502e0923e
commit
1eb14becde
@ -16,7 +16,7 @@ fun <T> StandardInput(
|
||||
disabled: Boolean = false,
|
||||
placeholder: String? = null,
|
||||
attributesCustomizer: AttrBuilderContext<HTMLInputElement> = {},
|
||||
onChange: (T) -> Unit
|
||||
onChange: HTMLInputElement.(T) -> Unit
|
||||
) {
|
||||
Input(type) {
|
||||
classes("uk-input")
|
||||
@ -32,7 +32,7 @@ fun <T> StandardInput(
|
||||
}
|
||||
}
|
||||
|
||||
onInput { onChange(it.value) }
|
||||
onInput { event -> event.target.onChange(event.value) }
|
||||
|
||||
if (disabled) {
|
||||
disabled()
|
||||
@ -51,7 +51,9 @@ fun <T> DefaultInput(
|
||||
vararg modifiers: UIKitModifier,
|
||||
attributesCustomizer: AttrBuilderContext<HTMLInputElement> = {},
|
||||
onChange: (T) -> Unit
|
||||
) = StandardInput(type, value, modifiers = modifiers, disabled, placeholder, attributesCustomizer, onChange)
|
||||
) = StandardInput(type, value, modifiers = modifiers, disabled, placeholder, attributesCustomizer) {
|
||||
onChange(it)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun <T> StandardInput(
|
||||
|
Loading…
Reference in New Issue
Block a user