Skip to content

Massive bug with handleTaggedFormSubmitEvent submitting a prevented form #4693

Open

Description

@shahyar

Past Issues Searched

  • I have searched open and closed issues to make sure that the bug has not yet been reported

Issue is a Bug Report

  • This is a bug report and not a feature request, nor asking for self-hosted support

Using official Plausible Cloud hosting or self-hosting?

Self-hosting

Describe the bug

When you assign plausible-event-name to a <form>, the Plausible JS will RE-SUBMIT THE FORM. This behavior is completely undocumented.

This will cause a controlled form (ie. in a React app) to be re-submitted, even if I didn't want it to be submitted.

I'm honestly shocked somebody thought this was a good idea.

Expected behavior

First, the handler should check event.defaultPrevented BEFORE attempting to defaultPrevent itself and then re-submit.

Second, the documentation should show a massive red warning with why you should not use this on a controlled <form>.

Screenshots

No response

Environment

- OS: all
- Browser: all
- Browser Version: all

Likely affects Plausible Cloud.

Activity

  1. ukutaht commented on Oct 18, 2024

    @ukutaht
    Contributor

    Thanks you for the bug report @shahyar!

    Your tone, however, is unacceptable. If you cannot stay respectful you will not be allowed to participate in any future discussions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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