Skip to content

Don't assume the main form element is the only form on the page#315

Merged
davidjamesstone merged 1 commit intomainfrom
fix/DF-876-fix-map-with-cookie-banner-form
Feb 24, 2026
Merged

Don't assume the main form element is the only form on the page#315
davidjamesstone merged 1 commit intomainfrom
fix/DF-876-fix-map-with-cookie-banner-form

Conversation

@davidjamesstone
Copy link
Copy Markdown
Contributor

@davidjamesstone davidjamesstone commented Feb 24, 2026

Proposed change

We have code in the client JS that explicitly codes around clicking buttons within the map causing a submit event to our main form. It would be nice if we didn't have to do this and it was handled inside the interactive map.
The current workaround code wasn't expecting there to be two forms which is the case when GA is enabled and there's a cookie banner present.

This fixes the issue by looking to the closest <form> rather than the first in the DOM

Jira ticket: https://eaflood.atlassian.net/browse/DF-876

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Misc. (documentation, build updates, etc)

Checklist

  • You have executed this code locally and it performs as expected.
  • You have added tests to verify your code works.
  • You have added code comments and JSDoc, where appropriate.
  • There is no commented-out code.
  • You have added developer docs in README.md and docs/* (where appropriate, e.g. new features).
  • The tests are passing (npm run test).
  • The linting checks are passing (npm run lint).
  • The code has been formatted (npm run format).

@sonarqubecloud
Copy link
Copy Markdown

@davidjamesstone davidjamesstone merged commit c516e7a into main Feb 24, 2026
25 checks passed
@davidjamesstone davidjamesstone deleted the fix/DF-876-fix-map-with-cookie-banner-form branch February 24, 2026 16:48
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

Successfully merging this pull request may close these issues.

2 participants