govuk_publishing_components 13.8.0 → 13.8.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: 27bb1983d939c2b0178f74229c78a912811ed892e32b6869d77ddaf2b089a58a
4
- data.tar.gz: c1e6ab12c9cfc5fe6c0a87fa1f701235b1f94fced5dc4b572f48e86f0535773c
3
+ metadata.gz: 935e9dfcd4eb2601b445f953a0fcbfe3858aa25b9a9a6c23c741f908fb041edd
4
+ data.tar.gz: 36cee7a76d1479ad1a04945ff4f7f0798de07585eaa4ec9a6dbe18c20d41beca
5
5
  SHA512:
6
- metadata.gz: 4fb7a1c1ef6cb45c8002dfe5d89f0ffa59024473320a436758d1a9d145a8e3d5b1d7719b0b7346379ce1598b1003d60842456b82f3ff972636ee2a1f529b237f
7
- data.tar.gz: 1a33708b2cd550298c2985f731c6fad09e0890affd70bf5a8906a7fd530a6d6c717465043b62ed31db250537d347c2902261541a717515f8ced22010006ee719
6
+ metadata.gz: 8dbd777c08df541b871be4916f199993537b3c52ccbafdf25bed302083d1aef04631fa688a4ece15435b1f38bf810f675a9f0d6902fb29afa705e367e085c8ba
7
+ data.tar.gz: eded35362e217f9925fc3d27b55b9a1840da88bc7681278b5aaa9172a5bd7a57396e9de440f804a35ec74aadd597653d5eac5501652e2aebbb8a437cfffd42a3
@@ -28,13 +28,18 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
28
28
  };
29
29
 
30
30
  this.onConfirm = function(label, removeDropDown) {
31
+
32
+ function escapeHTML(str){
33
+ return new Option(str).innerHTML;
34
+ }
35
+
31
36
  if ($selectElem.data('track-category') !== undefined && $selectElem.data('track-action') !== undefined) {
32
37
  track($selectElem.data('track-category'), $selectElem.data('track-action'), label, $selectElem.data('track-options'));
33
38
  }
34
39
  // This is to compensate for the fact that the accessible-autocomplete library will not
35
40
  // update the hidden select if the onConfirm function is supplied
36
41
  // https://github.com/alphagov/accessible-autocomplete/issues/322
37
- var value = $selectElem.children("option").filter(function () { return $(this).html() == label; }).val();
42
+ var value = $selectElem.children("option").filter(function () { return $(this).html() == escapeHTML(label); }).val();
38
43
  if (typeof value !== 'undefined') {
39
44
  $selectElem.val(value).change();
40
45
  }
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '13.8.0'.freeze
2
+ VERSION = '13.8.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: 13.8.0
4
+ version: 13.8.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: 2019-01-31 00:00:00.000000000 Z
11
+ date: 2019-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govspeak