mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-12-22 08:37:24 +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,
|
disabled: Boolean = false,
|
||||||
placeholder: String? = null,
|
placeholder: String? = null,
|
||||||
attributesCustomizer: AttrBuilderContext<HTMLInputElement> = {},
|
attributesCustomizer: AttrBuilderContext<HTMLInputElement> = {},
|
||||||
onChange: (T) -> Unit
|
onChange: HTMLInputElement.(T) -> Unit
|
||||||
) {
|
) {
|
||||||
Input(type) {
|
Input(type) {
|
||||||
classes("uk-input")
|
classes("uk-input")
|
||||||
@ -32,7 +32,7 @@ fun <T> StandardInput(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onInput { onChange(it.value) }
|
onInput { event -> event.target.onChange(event.value) }
|
||||||
|
|
||||||
if (disabled) {
|
if (disabled) {
|
||||||
disabled()
|
disabled()
|
||||||
@ -51,7 +51,9 @@ fun <T> DefaultInput(
|
|||||||
vararg modifiers: UIKitModifier,
|
vararg modifiers: UIKitModifier,
|
||||||
attributesCustomizer: AttrBuilderContext<HTMLInputElement> = {},
|
attributesCustomizer: AttrBuilderContext<HTMLInputElement> = {},
|
||||||
onChange: (T) -> Unit
|
onChange: (T) -> Unit
|
||||||
) = StandardInput(type, value, modifiers = modifiers, disabled, placeholder, attributesCustomizer, onChange)
|
) = StandardInput(type, value, modifiers = modifiers, disabled, placeholder, attributesCustomizer) {
|
||||||
|
onChange(it)
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun <T> StandardInput(
|
fun <T> StandardInput(
|
||||||
|
Loading…
Reference in New Issue
Block a user