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

Preview fails to render when there's a SwingPanel

Open asapha opened this issue 4 years ago • 4 comments

The preview pane is stuck on "Rendering preview" when trying to preview this

@Preview
@Composable
private fun TestPreview() {
    SwingPanel(
        factory = { JTextArea("Hello world") }
    )
}

Gradle dependency: 1.0.0-alpha3 Plugin: org.jetbrains.compose.desktop.ide (1.0.0-alpha4-build315)

From Intellij:

IntelliJ IDEA 2021.2 (Ultimate Edition) Build #IU-212.4746.92, built on July 27, 2021 Runtime version: 11.0.11+9-b1504.13 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 11.5.1 Kotlin: 212-1.5.10-release-IJ4746.92

asapha avatar Aug 22 '21 17:08 asapha

@asapha and with plain Compose it works fine on your system?

akurasov avatar Aug 23 '21 07:08 akurasov

Yes it works, although I needed to add a size (modifier = Modifier.size(80.dp)) to the call for anything to appear.

Further info: I need to restart the IDE in order to make any other preview work after trying the above.

asapha avatar Aug 23 '21 09:08 asapha

Reproduced with the same idea, plugin build 310.

akurasov avatar Aug 23 '21 09:08 akurasov

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

okushnikov avatar Aug 26 '24 16:08 okushnikov