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

button elements should have type="button" #10529

Closed
jaydenseric opened this issue Apr 1, 2021 · 0 comments
Closed

button elements should have type="button" #10529

jaydenseric opened this issue Apr 1, 2021 · 0 comments

Comments

@jaydenseric
Copy link

button elements created by Mapbox should have type="button", to ensure they never function as submit buttons if the map is within a form element.

mapbox-gl-js version: v2.2.0

browser: N/A

Steps to Trigger Behavior

  1. Create a HTML form, and mount a Mapbox map somewhere inside it.

  2. Click the toggle attribution button in the bottom right of the map, and notice that it submits the form:

    Screen Shot 2021-04-01 at 5 36 04 pm

Expected Behavior

Buttons created by Mapbox within the map should not submit a surrounding form when clicked. For proper semantics, they should have type="button".

Actual Behavior

The opposite.

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

No branches or pull requests

3 participants