Skip to content

AttributeInterceptor is not working as intended #4676

@Yeenot

Description

@Yeenot

Describe the bug
AttributeInterceptor does not work as intended; it always forwards attributes to the top-level element.

Dependencies

leptos = { version = "0.8.14", features = ["csr"] }
leptos-use = { version = "0.18.3", default-features = false }
leptos_router = "0.8.11"

To Reproduce

#[component]
pub fn Child() -> impl IntoView {
    view! {
        <AttributeInterceptor let:attrs>
            <div id="wrapper">
                <div id="inner" {..attrs} />
            </div>
        </AttributeInterceptor>
    }
}

#[component]
pub fn Parent() -> impl IntoView {
    let spread_onto_component = view! {
        <{..} aria-label="a component with attribute spreading"/>
    };
    view! {
        <Child {..spread_onto_component} />
    }
}

Output

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions