Thread
#compose-web
    andbapps

    andbapps

    1 year ago
    Hi everyone! I was wondering about the nesting of modifiers in Compose for Web. Example:
    @Composable
    fun ModiferTest() {
        Box(Modifier.background(Color.Blue).padding(16.dp).background(Color.Red).padding(8.dp).background(Color.Green)) {
            Text("Modifier Test")
        }
    }
    As you can see in the images, the function works correctly on Compose for Desktop, but on Compose for Web it discards all but the innermost modifiers (due to the way that modifiers currently work on web). This breaks the idea that each modifier doesn't need to have knowledge of the inner content/modifiers, which seems like an important aspect of the Compose UI system. Obviously multiplatform widgets are still experimental, but I wanted to know if something is planned to address this, since it seems like a somewhat core issue
    [JB] Shagen

    [JB] Shagen

    1 year ago
    Hi! We aware of this - unfortunately you are right. We've decided to do following - to do our best with trying to deliver same experience with using html and, at the same time, work in direction of being able to render standard components in canvas. Unlike popular opinion those are not mutually exclusive scenarios. However right now we are working on polishing and improving html layer so that we'll be able to move forward with delivering same experience in html. I can not give exact estimates however optimistically we'll be back for gradually improving components UX (both in html and canvas)
    spierce7

    spierce7

    1 year ago
    @[JB] Shagen So there is a plan to allow rendering standard compose components to canvas on web? Am I understanding that right?
    [JB] Shagen

    [JB] Shagen

    1 year ago
    We want to achieve it at some point, Scott