Skip to content

onclick seems to not be working on web components #14704

Open
@GCastilho

Description

@GCastilho

Describe the bug

Using onclick on a web-component (ApplePay button, on this case) is not working. The handler function is not being called. If I change to Svelte's 4 on:click the handler function is called normally

As far as I understand the apple-pay-button web-component fires a click event

Reproduction

https://github.com/GCastilho/svelte-5-onclick-bug-reproduction

(Note the usage of 'vite-plugin-mkcert' to use https on localhost. HTTPS is required for the ApplePay button to be displayed)

Logs

No response

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (8) x64 Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz
    Memory: 3.05 GB / 15.77 GB
  Binaries:
    Node: 20.16.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.8.1 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.7.0 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (131.0.2903.86)
    Internet Explorer: 11.0.26100.1882
  npmPackages:
    svelte: ^5.2.7 => 5.11.2

Severity

blocking an upgrade

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