Skip to content

Commit c516e7a

Browse files
Don't assume the main form element is the only form on the page (#315)
1 parent f15563d commit c516e7a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)