Skip to content

Svelte 5, an error should be thrown when event isn't defined #10393

Closed
@rob-balfre

Description

@rob-balfre

Describe the bug

When working with children snippets and event bubbling an error should be thrown if event isn't defined.

Since I was passing onfocus to the children snippet, the snippet needed to be defined explicitly so that onfocus is defined:

<TogglePopover>
+ {#snippet children(onfocus)}
    <input type="text" placeholder="Select Search" {onfocus} />
+ {/snippet}
</TogglePopover>

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAE5WRQWvDMAyF_4oQg6YQknubhu2426C7zTukjtIYHMs4SrcR8t9HmrRrNhjb0U9PT_rkHitjqcXNS4-uaAg3-OA9xigffny0J7JCGGPLXdCjkrU6GC-5ckpM4zkI7MmSlj0VQddQBW5glaS3YjLFrLbKZelXv8t8_ghvhRMQhkN3OFgCqQnYVay7FuhETsC45QRheObj0dITez5RyFI_pS1caY4xNlyaylCJGwkdDfEV8tb6T9rF7AlXYZIu5BlY4Q_ihe0cmxnnO4FxhZ1CoXdRCN4Wmmq2JYWdmreFaV2F0M8HGiDNxwHL0N-4F86_glsS6EHXxpaBHAywgzsf2LfRenupk6Vm1FsphCLXWXuuOYCqc1oMu8uvRrSGfmxTotm1bCmxfIxWBJs8h1UMNKUO307X3wdyJYXrItEcuB5-Er8On469s5naAgAA

Logs

No response

System Info

N/A

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions