https://kotlinlang.org logo
#compose-web
Title
# compose-web
b

Big Chungus

05/24/2021, 12:15 AM
how do I merge two
attrs
without one overiding other's classes? I've tried this, but only the latest classes remain
Copy code
@MDCDsl
@Composable
inline fun MDCIconButton(
  icon: String,
  crossinline attrs: AttrsBuilder<Tag.Button>.() -> Unit = {},
  crossinline style: (StyleBuilder.() -> Unit) = {},
) {
  MDCIconButton(
    attrs = {
      classes("mdc-icon-button", "material-icons")
      attrs() // <------------------------------ If the consumer sets classes here, above classes are gone
    },
    style = style,
  ) {
    Text(icon)
  }
}
a

Akif Abasov [JB]

05/24/2021, 6:56 AM
It’s in our plans to make classes incremental to fix that case.
1
👍 1
b

Big Chungus

05/24/2021, 11:14 AM
Is there an issue for it that I could track?
a

Akif Abasov [JB]

05/24/2021, 11:47 AM
There isn’t, but you can file an issue in github
b

Big Chungus

05/24/2021, 12:08 PM
c

Chris Sinco [G]

05/25/2021, 6:59 PM
10 Views