Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextFieldColors does not work #23

Open
pspmoe opened this issue Sep 12, 2024 · 2 comments · May be fixed by #26
Open

TextFieldColors does not work #23

pspmoe opened this issue Sep 12, 2024 · 2 comments · May be fixed by #26
Labels
enhancement New feature or request

Comments

@pspmoe
Copy link

pspmoe commented Sep 12, 2024

The same Compose widget displays differently in Compose Desktop and Storytale:

// Compose Desktop
fun main() = application {
    Window(
        onCloseRequest = ::exitApplication,
        title = "Example"
    ) {
        TextField(
            value = "ABCDEFG",
            onValueChange = {},
            isError = true,
            supportingText = { Text("This is a supporting text!") }
        )
    }
}

Display:
image

// Storytale
val `TextField Story` by story {
    TextField(
        value = "ABCDEFG",
        onValueChange = {},
        isError = true,
        supportingText = { Text("This is a supporting text!") }
    )
}

Display:
image

The SupportingText colors of the two are different. The expected color is red, but the actual color is black.

Also, specifying TextFieldDefaults.colors() in the TextField has no effect either, all colors remain as they are.

@whitescent whitescent added the enhancement New feature or request label Sep 12, 2024
@whitescent
Copy link
Collaborator

Thank you for the report, this is because Storytale currently uses a separate Theme for the Gallery App, but does not apply the MaterialTheme to the story component

@pspmoe
Copy link
Author

pspmoe commented Sep 12, 2024

Thank you for the report, this is because Storytale currently uses a separate Theme for the Gallery App, but does not apply the MaterialTheme to the story component

Explicitly specifying the colors doesn't work either, is this for the same reason?

fun main() = application {
    Window(
        onCloseRequest = ::exitApplication,
        title = "Example"
    ) {
        TextField(
            value = "ABCDEFG",
            onValueChange = {},
            colors = TextFieldDefaults.colors(
                focusedTextColor = Color.Red,
                unfocusedTextColor = Color.Red
            )
        )
    }
}

Display:
image

val `TextField Story` by story {
    TextField(
        value = "ABCDEFG",
        onValueChange = {},
        colors = TextFieldDefaults.colors(
            focusedTextColor = Color.Red,
            unfocusedTextColor = Color.Red
        )
    )
}

Display:
image

@whitescent whitescent linked a pull request Dec 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants