fun MyInputComponent()

in html/integration-core/src/jsMain/kotlin/androidx/compose/web/sample/Sample.kt [273:336]


fun MyInputComponent(text: State<String>, onChange: (String) -> Unit) {
    Div({
        style {
            padding(50.px)
        }

        onTouchStart {
            println("On touch start")
        }
        onTouchEnd {
            println("On touch end")
        }
    }) {
        Text("Test onMouseDown")
    }

    Div {
        TextArea(
            value = text.value,
            attrs = {
                onKeyDown {
                    println("On keyDown key = : ${it.getNormalizedKey()}")
                }
                onInput {
                    onChange(it.value)
                }
                onKeyUp {
                    println("On keyUp key = : ${it.getNormalizedKey()}")
                }
            }
        )
    }
    Div {
        Input(type = InputType.Checkbox, attrs = {
            onInput {
                println("From div - Checked: " + it.value)
            }
        })
        Input(type = InputType.Text, attrs = {
            value(value = "Hi, ")
        })
    }
    Div {
        Input(
            type = InputType.Radio,
            attrs = {
                onInput {
                    println("Radio 1 - Checked: " + it.value)
                }
                name("f1")
            }
        )
        Input(
            type = InputType.Radio,
            attrs = {
                onInput {
                    println("Radio 2 - Checked: " + it.value)
                }
                name("f1")
            }
        )
        Input(type = InputType.Radio, attrs = {})
    }
}