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

Html form 'breaks' enter key for GeoBookmark #700

Closed
Ben3d1k7 opened this issue Nov 16, 2021 · 2 comments
Closed

Html form 'breaks' enter key for GeoBookmark #700

Ben3d1k7 opened this issue Nov 16, 2021 · 2 comments
Labels

Comments

@Ben3d1k7
Copy link

Hey,
my second issue today :)
I experienced a potentially unwanted behaviour in GeoBookmark when an ol.Map is nested within a html form.
I created a jsfiddle for you with a minimal example which is based on your GeoBookmark example.
If one adds a new Bookmark via pressing the enter key the first entry in the bookmark list is being deleted. If the bookmark list is empty it is impossible to add a new bookmark (with the enter key) due to the newly added bookmark being deleted right after adding it. The issue seems to be that pressing enter while being in html form triggers the delete button in the bookmarks list. Adding a hidden submit button to the form which is doing nothing prevents this behaviour.

(Also it would be nice to be able to customize the text for the delete button which currently is 'Suppr.')

Thanks!

@Viglino
Copy link
Owner

Viglino commented Nov 16, 2021

Last commit should prevent default behavior on forms.

@Viglino Viglino added the bug label Nov 16, 2021
@Viglino
Copy link
Owner

Viglino commented Nov 16, 2021

I've also added a deleteTitle option to let you customize the delete button title...

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

No branches or pull requests

2 participants