Thread
#compose
    amar_1995

    amar_1995

    2 years ago
    How to close keyboard when imeActionPerformed.
    When I am passing calling
    ContextAmbient.current
    inside
    onImeActionPerformed
    it throws
    Functions which invoke @Composable functions must be marked with the @Composable annotation
    error
    l

    Leland Richardson [G]

    2 years ago
    current
    of an ambient can only be called in a composable function. You’re trying to do it in a lambda of a callback. Instead, call it in the composable and cache it in a variable, and then use the variable in the lambda.
    amar_1995

    amar_1995

    2 years ago
    customTextFeild(
    	hint = HINT,
    	value = value.value,
    	onValueChange = { value.value = it },
    	modifier = LayoutFlexible(1f) + LayoutGravity.Center + LayoutPadding(
    		left = 8.dp,
    		right = 8.dp
    	),
    	onImeClickPerformed = {
    		context
    		onSearchClick(value.value)
    
    	}
    )
    Like this 👆