Skip to content

Instantly share code, notes, and snippets.

View oscarduignan's full-sized avatar
🐢
Catching up

Oscar Duignan oscarduignan

🐢
Catching up
View GitHub Profile
@oscarduignan
oscarduignan / _autocomplete.js
Last active August 21, 2024 14:39 — forked from adamliptrot-oc/_autocomplete.js
Loads and polyfills the autocomplete
// Note - updated to work with the HMRC Frontend implementation
// https://github.com/hmrc/play-frontend-hmrc#adding-accessible-autocomplete-css-and-javascript
if (typeof HMRCAccessibleAutocomplete != 'undefined' && document.querySelector('[data-module="hmrc-accessible-autocomplete"]') != null) {
document.querySelectorAll('[data-module="hmrc-accessible-autocomplete"]').forEach(function (originalSelect) {
// load autocomplete - now handled by the HMRC component wrapper in Twirl
// accessibleAutocomplete.enhanceSelectElement({
// selectElement: originalSelect,
// showAllValues: true