Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zoomer buttons cause a form submition #39

Open
pepkin88 opened this issue Dec 20, 2023 · 1 comment
Open

Zoomer buttons cause a form submition #39

pepkin88 opened this issue Dec 20, 2023 · 1 comment

Comments

@pepkin88
Copy link

Because the zoomer buttons don't have the type attribute set on them, it gets the default value, which is submit. That's why when Zoomist gets instantiated inside a form, clicking on those button will cause a form submission.

The solution to this would be setting the type attribute to "button" upon the element creation.

@adriallongarriu
Copy link

I was having the same problem issue.
For now I used the following code to fix it temporarily:

const zoomist = new Zoomist('.zoomist-container', {
      on: {
          ready(zoomist, scale) {
            $('.zoomist-zoomer-button').attr("type", "button");
          }
        }
  })

After ready and the buttons are created add the type "button"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants