DioxusLabs / DioxusLabs/dioxus

spread attributes not merged with existing class or style attributes

Open
#3,717 2 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

**Problem**

Spread attributes are not merged with existing `class` or `style` attributes.

**Steps To Reproduce**

Steps to reproduce the behavior:

running this modified `spread.rs` example for minimal reproducibility:

```rs
use dioxus::prelude::*;

fn main() {
let dom = VirtualDom::prebuilt(app);
let html = dioxus_ssr::render(&dom);

println!("{}", html);
}

fn app() -> Element {
rsx! {
SpreadableComponent {
class: "class2",
left: 1,
}
}
}

#[component]
fn SpreadableComponent(#[props(extends = GlobalAttributes)] attributes: Vec) -> Element {
rsx! {
div { class: "class1", style: "top:1;", ..attributes }
}
}
```

outputs this html with separated `class` and `style` attributes:

```


```

**Expected behavior**

it should output something like this:

```


```

**Environment:**

- Dioxus version: 0.6.3
- Rust version: 1.84.1
- OS info: Linux
- App platform: desktop

**Questionnaire**

I don't have time to fix this right now, but maybe later.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.