compose-multiplatform-core icon indicating copy to clipboard operation
compose-multiplatform-core copied to clipboard

CMP-5786 iOS TF2: Implement textFieldMagnifierNode

Open alexzhirkevich opened this issue 1 year ago • 3 comments

Fixes 5786

Testing

Snippet for testing
val style = TextStyle(fontSize = 22.sp)
var textFieldState by remember { mutableStateOf("I am TextField") }
val textFieldState2 = remember { TextFieldState("I am TextField 2") }
Column(Modifier.fillMaxWidth().verticalScroll(rememberScrollState()).imePadding()) {
    BasicTextField(
        textFieldState,
        onValueChange = { textFieldState = it },
        Modifier.padding(16.dp).fillMaxWidth(),
        textStyle = style
    )
    Box(Modifier.height(16.dp))
    BasicTextField(
        textFieldState2, Modifier.padding(16.dp).fillMaxWidth(), textStyle = style
    )

    val s3 = remember { TextFieldState(loremIpsum(wordCount = 10)) }
    BasicTextField(
        state = s3,
        textStyle = style,
        modifier = Modifier
            .padding(16.dp)
            .padding(start = 100.dp)
            .width(200.dp)
            .border(1.dp, Color.Black)
    )

    val s6 = remember { TextFieldState("SingleLine scrollable " + loremIpsum(wordCount = 50)) }
    BasicTextField(
        state = s6,
        textStyle = style,
        modifier = Modifier.padding(16.dp).padding(start = 100.dp).width(200.dp)
            .border(1.dp, Color.Black),
        lineLimits = TextFieldLineLimits.SingleLine
    )

    val s4 = remember { TextFieldState("Multiline scrollable " + loremIpsum(wordCount = 50)) }
    BasicTextField(
        state = s4,
        textStyle = style,
        modifier = Modifier.padding(16.dp).padding(start = 100.dp).width(200.dp)
            .border(1.dp, Color.Black),
        lineLimits = TextFieldLineLimits.MultiLine(maxHeightInLines = 6)
    )

    val s5 = remember { TextFieldState(loremIpsum(wordCount = 30)) }

    BasicTextField(
        state = s5,
        textStyle = style,
        modifier = Modifier.padding(50.dp).fillMaxWidth(),
        decorator = {
            TextFieldDefaults.TextFieldDecorationBox(
                innerTextField = it,
                enabled = true,
                interactionSource = remember { MutableInteractionSource() },
                singleLine = false,
                value = s5.text.toString(),
                visualTransformation = VisualTransformation.None,
                leadingIcon = {
                    Icon(
                        imageVector = Icons.Default.Star,
                        contentDescription = null
                    )
                },
                trailingIcon = {
                    Icon(
                        imageVector = Icons.Default.Star,
                        contentDescription = null
                    )
                }
            )
        }
    )
}

This should be tested by QA

Release Notes

Features - iOS

  • Magnifier support for BasicTextField(TextFieldState)

alexzhirkevich avatar Sep 08 '24 13:09 alexzhirkevich

CI checks are not listed here

You should create pull/1549 branch and push. Then CI checks will run

igordmn avatar Sep 09 '24 18:09 igordmn

CI checks are not listed here

You should create pull/1549 branch and push. Then CI checks will run

@igordmn , that what I did: https://github.com/JetBrains/compose-multiplatform-core/tree/pull/1549 It went well on CI, but hasn't beed added to checks here.

ASalavei avatar Sep 09 '24 18:09 ASalavei

hasn't beed added to checks here.

It was added to the last commit you pushed to that branch. it probably needs to be the last commit of the PR to appear on the PR itself

alexzhirkevich avatar Sep 10 '24 07:09 alexzhirkevich

Thanks a lot!

mazunin-v-jb avatar Mar 07 '25 12:03 mazunin-v-jb