govuk_publishing_components 45.6.0 → 45.6.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b7e677ebcf4bc8ae065476415230279eacde3aff30b4f673a682e9e340a90f4
|
4
|
+
data.tar.gz: e8edaf344a5ebd5dd6e88c5edfdd0f013785daeb54dd031da6c41e9a97d8ffbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3efebe93517bb33fbe07f055c063108ce045db6de8d808706a4e474041d4b5bf0774d620aa804a31af2897751f76f8fdfb8e7f6033f2a904e1aed7fda4383615
|
7
|
+
data.tar.gz: f395017aded3b8d3e224aaa5c1442b58cec4c357e632f2d157ec305cd5605a734e988770f6849667d1a9569e11831fc5bb767428447dc3de78e864b5c07ecfc2
|
@@ -65,6 +65,11 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
65
65
|
// part of the `page_view` event on the subsequent page load
|
66
66
|
window.sessionStorage &&
|
67
67
|
window.sessionStorage.setItem('searchAutocompleteAccepted', 'true')
|
68
|
+
} else {
|
69
|
+
// Explicitly set `tool_name` to `null` if the user has not accepted a suggestion, as
|
70
|
+
// `undefined` will not overwrite the current value in the analytics state (meaning a
|
71
|
+
// previously set value would be used if there was one)
|
72
|
+
data.tool_name = null
|
68
73
|
}
|
69
74
|
|
70
75
|
data.length = Number(this.$searchInput.dataset.autocompleteSuggestionsCount)
|
data/app/assets/javascripts/govuk_publishing_components/components/search-with-autocomplete.js
CHANGED
@@ -64,11 +64,12 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
64
64
|
// with the autocomplete menu at all, and then hits Enter to try to submit the form - but it
|
65
65
|
// isn't submitted.
|
66
66
|
//
|
67
|
-
// This manually triggers our form submission logic when the Enter key is pressed
|
68
|
-
// workaround (which will do nothing if the form is already in the
|
69
|
-
// through `onConfirm` because the user has accepted a suggestion).
|
67
|
+
// This manually triggers our form submission logic when the Enter key is pressed while the
|
68
|
+
// dropdown is shown as a workaround (which will do nothing if the form is already in the
|
69
|
+
// process of submitting through `onConfirm` because the user has accepted a suggestion).
|
70
70
|
this.$autocompleteInput.addEventListener('keydown', (e) => {
|
71
|
-
|
71
|
+
const dropdownVisible = this.$autocompleteInput.getAttribute('aria-expanded') === 'true'
|
72
|
+
if (dropdownVisible && e.key === 'Enter') this.submitContainingForm()
|
72
73
|
})
|
73
74
|
}
|
74
75
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_publishing_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 45.6.
|
4
|
+
version: 45.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chartkick
|