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

Form submitted on input clear when geocoder is within form #56

Closed
walter opened this issue Sep 2, 2016 · 0 comments
Closed

Form submitted on input clear when geocoder is within form #56

walter opened this issue Sep 2, 2016 · 0 comments

Comments

@walter
Copy link

walter commented Sep 2, 2016

When the geocoder div is within a form and .geocoder-icon-close button clicked or user hits return after selecting a suggestion from keyboard, the form is submitted.

I confirmed this by taking the example code from here and adding a wrapping form around div.map and div.geocoder-container. Then I entered an address with suggestions and clicked the "x" (aka button.geocoder-icon-close). The form was submitted rather than simply clearing the input value.

I then also repeated the test, but instead of clicking the "x", I arrowed down to select a suggestion and clicked return. The form was also submitted.

This was in Safari, Chrome, and Firefox.

The mapbox-gl-geocoder is really handy! Thanks for all your great work. Just a little detail that would be great to fix or have insight about how to eliminate the behavior.

tristen added a commit that referenced this issue Sep 15, 2016
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

1 participant