Skip to content

onFormieInit event not working in Safari #2840

@anita-chouhan

Description

@anita-chouhan

Describe the bug

We are using onFormieInit to attach a function to Formie initialisation. It is failing on Safari.

Sample code

(function (window) {
document.addEventListener('onFormieInit', (e) => {
    // The instance of the Formie JS library
    let Formie = e.detail.formie;
    console.log(Formie);

    // The `<form>` HTML element
    let $form = e.detail.$form;
    console.log($form);

    // The instance of the Formie form class, which encapsulates most logic
    let form = e.detail.form;
    console.log(form);

    // The `formId` of the form, used as a unique identifier
    let formId = e.detail.formId;
    console.log(formId);

  });
})(this);

Steps to reproduce

  1. Add an event listener for Formie.
  2. Test the console logs on Safari version 26.5.

Form settings

  • Multi-page form: No
  • Submission Method: Ajax
  • Client-side Validation: Yes
  • Custom Form Templates: No

Craft CMS version

5.9.16

Plugin version

3.1.16

Multi-site?

No

Additional context

It is working on certain versions of Firefox, Chrome and Safari.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions