This took me a bit to figure out, but the <button> HTML elements in the <ZoomControl> component are missing their type="button" attributes.
Since the default type for buttons is submit, this means that <ZoomControl> cannot be used when the map is inside a <form>, otherwise clicking on zoom-in or zoom-out performs the action and immediately submits the form the map is in :(
Hello,
This took me a bit to figure out, but the
<button>
HTML elements in the<ZoomControl>
component are missing theirtype="button"
attributes.Since the default type for buttons is
submit
, this means that<ZoomControl>
cannot be used when the map is inside a<form>
, otherwise clicking on zoom-in or zoom-out performs the action and immediately submits the form the map is in :(The workaround is to simply add
type="button"
, which is a best practice nowadays (see html - What is the default button type? - Stack Overflow)Thanks