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

Closed
pepkin88 opened this issue Dec 20, 2023 · 2 comments
Closed

Zoomer buttons cause a form submition #39

pepkin88 opened this issue Dec 20, 2023 · 2 comments

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"

@cotton123236
Copy link
Owner

cotton123236 commented Jun 5, 2024

Hey @pepkin88 @adriallongarriu ,

The buttons are set the type attribute to button by default now (v2.0.12). Thanks for waiting and liking this library!

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

3 participants