Skip to content

on:* with ...props override not working #2520

@5P5

Description

@5P5

Describe the bug

I understood the last passed prop win on multiple identical props passed.

But it does not work for something like on:change
See play here
I think in CompA the on:change should be overwritten with the passed function. Yet both are triggered!
In CompB the explicit ?? assign overwrites as expected.

Am I misunderstanding something or is this a bug?

Your Example Website or App

https://playground.solidjs.com/anonymous/8911364f-e059-4a3b-99f0-35b9afbeb994

Steps to Reproduce the Bug or Issue

import { render } from "solid-js/web";

const hi=()=>console.log(11);

const CompA=(props)=><input on:change={hi} {...props} placeholder="fix"/>;
const CompB=(props)=><input on:change={props["on:change"]??hi} placeholder="default" {...props}/>;

const App=()=><>
A=<CompA on:change={e=>console.log(22)} placeholder="A"/>
B=<CompB on:change={e=>console.log(33)} placeholder="B"/>
</>

render(() => , document.getElementById("app")!);

Expected behavior

on:change prop should be overwritten with the passed on:change function

Screenshots or Videos

No response

Platform

anywhere

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions