Skip to content

oninvalid does not fire #14886

@kvangrae

Description

@kvangrae

Describe the bug

When an input element is invalid, the "invalid" event type is not being fired off. Neither the oninvalid HTML attribute nor the input.addEventListener('invalid', ...) Javascript call captures the event.

Reference: https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event

Reproduction

https://svelte.dev/playground/a35503b0ea7c481ca7f7fa89b9d4f679?version=5.16.1

Logs

No response

System Info

System:
    OS: Linux 4.18 Red Hat Enterprise Linux 8.10 (Ootpa)
    CPU: (4) x64 Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
    Memory: 8.79 GB / 15.21 GB
    Container: Yes
    Shell: 4.4.20 - /bin/bash
  Binaries:
    Node: 20.18.0 - ~/.nvm/versions/node/v20.18.0/bin/node
    npm: 10.8.2 - ~/.nvm/versions/node/v20.18.0/bin/npm
    bun: 1.1.38 - ~/.nvm/versions/node/v20.18.0/bin/bun
  Browsers:
    Chrome: 130.0.6723.69
  npmPackages:
    svelte: ^5.14.3 => 5.14.4

Severity

annoyance

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