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

Fold button submits forms #259

Closed
mstenta opened this issue Jan 5, 2020 · 5 comments
Closed

Fold button submits forms #259

mstenta opened this issue Jan 5, 2020 · 5 comments

Comments

@mstenta
Copy link
Contributor

mstenta commented Jan 5, 2020

If you use the fold property to collapse a layer group, and the map is within a form, clicking the arrow (which is a <button>) to expand the group submits the form.

I think we just need to add e.preventDefault(); to fix this. Here is the click function:

btn.onclick = function (e) {

For reference, here is the click callback for the main LayerSwitcher button, which does have a e.preventDefault(); in it:

button.onclick = function(e) {

@mstenta
Copy link
Contributor Author

mstenta commented Jan 5, 2020

I created a pull request for review: #260

@walkermatt
Copy link
Owner

@mstenta thanks for reporting and the PR 👍

@mstenta
Copy link
Contributor Author

mstenta commented Jan 18, 2020

Thanks @walkermatt for reviewing and merging!

Do you foresee a new tagged release in the near future? No rush - just curious. I'm referencing a specific commit in my package.json now.

@walkermatt
Copy link
Owner

Just published https://www.npmjs.com/package/ol-layerswitcher/v/3.5.0 🎉

@mstenta
Copy link
Contributor Author

mstenta commented Jan 20, 2020

Terrific! Thank you!

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