Skip to content

Commit f7db329

Browse files
Don't assume the main form element is the only form on the page
1 parent f15563d commit f7db329

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/client/javascripts/location-map.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export function initMaps(config = {}) {
112112
// If there are location components on the page fix up the main form submit
113113
// handler so it doesn't fire when using the integrated map search feature
114114
if (locations.length) {
115-
const form = document.querySelector('form')
115+
const form = locations[0].closest('form')
116116

117117
if (form === null) {
118118
return

0 commit comments

Comments
 (0)