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: 89d4b2cf8eb92f4e6ba16a0356376d3edf18385b255300685a3043854f8a3e79
4
- data.tar.gz: 1ff1034efc9cc15da7d4983005147add12a8932b9412689983c6887ef69105c5
3
+ metadata.gz: 0b7e677ebcf4bc8ae065476415230279eacde3aff30b4f673a682e9e340a90f4
4
+ data.tar.gz: e8edaf344a5ebd5dd6e88c5edfdd0f013785daeb54dd031da6c41e9a97d8ffbd
5
5
  SHA512:
6
- metadata.gz: 94051a6534ab5d51e9ddf779b522145b8cca591776564adabaa056f36166dc7a69669336b0187ea90440bca9ab0c8ab2c3efe16aae40ebda39d9b47fbac768e3
7
- data.tar.gz: fa76bf3cdf74b111c3c1e9d02542bea183435be9b3db3b48e7b99b760a1c52c9b073593f5bb712dc2060ea35cebcb42b405a5fdb77aaf0f0a47657d7cd913b8a
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)
@@ -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 as a
68
- // workaround (which will do nothing if the form is already in the process of submitting
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
- if (e.key === 'Enter') this.submitContainingForm()
71
+ const dropdownVisible = this.$autocompleteInput.getAttribute('aria-expanded') === 'true'
72
+ if (dropdownVisible && e.key === 'Enter') this.submitContainingForm()
72
73
  })
73
74
  }
74
75
 
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "45.6.0".freeze
2
+ VERSION = "45.6.1".freeze
3
3
  end
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.0
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-20 00:00:00.000000000 Z
11
+ date: 2024-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chartkick