Closed jiveturkeyJay closed 1 year ago
Something we could look at implementing in nhsuk-frontend
@DomBaker @truecroft2? 👀
Worth testing and assessing the impacts this could have for people with slower internet connections and just how long we would wait to discount a double-click of a button
Bug Report/Issue report
Not really a bug. On NBS we have had an issue with users double clicking and submitting forms twice. This has led some users to an error page, even though they have booked a vaccine. They then proceed to book another vaccine as they are told to. It seems some users routinely double click and cause extra load on the servers by doing so.
The solution is to add a debounce function similar to what the gov.uk site has https://github.com/alphagov/govuk-frontend/blob/main/src/govuk/components/button/button.js
I used a solution based on the approach that the gov.uk site uses.
This is a small slack thread discussing the issue https://nhsuk.slack.com/archives/CCPLQ9YAJ/p1637328178007900