anchor_view_components 0.34.0 → 0.34.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: dac91e813baa14c60b910413a95f818dca0b6f0cc6222d478de451f0f64c8a1f
4
- data.tar.gz: 95a62ccc7f3adbf94ca690ef069065398a84b926cd8c979146b59a8b880b1cc8
3
+ metadata.gz: b9b25030c275ae49c959a38c97f01a402ec50187a959d47da7f56991460f1634
4
+ data.tar.gz: 5e6b00a0b509ac178df6e1a4cdfe9df858bd9449a07ee3a38c48a31d1ec85ac4
5
5
  SHA512:
6
- metadata.gz: 905ae7cf939abfc10a1013e7c251a9987db73bdf4c4872a2d288ee4ae922b641a30ac109cae464c99fb50a2e8cc2a0e1ce77bd2499d28955d7fd6e7f09a9bc4c
7
- data.tar.gz: 8ebc34f8806f4c6cab7c8606b8d8a3d5c0d6963ba9619db5b12beccc1992bb2c7102be95979a2be0f4f05836307a72ae6b290bed75854f2af6c7fc14d031d885
6
+ metadata.gz: 263b68a6a485e0eed84164544b9529023c53f16c9aa45782a2993c97ecf99ada4c1343ce01474b812e0297349cc700f4bf5dd7c4b5e9f72677a56b97510c4f89
7
+ data.tar.gz: b1b87849037d8bc09452493e16a53bba369125d8793adbc23f1146aa5779c55a963fbe8da43f0a487da450579b1640987b88e3382fe75283bee47b0e01634e9e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.34.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 70e5b07: Handle form resets on typeahead select controller. Before this, the choices would get blank after a form reset.
8
+
3
9
  ## 0.34.0
4
10
 
5
11
  ### Minor Changes
@@ -3,10 +3,19 @@ import Choices from "choices.js";
3
3
 
4
4
  export default class extends Controller<HTMLSelectElement> {
5
5
  initialize(): void {
6
- new Choices(this.element, {
6
+ const choices = new Choices(this.element, {
7
7
  allowHTML: false,
8
8
  removeItemButton: this.element.multiple,
9
9
  itemSelectText: "",
10
10
  });
11
+
12
+ const form = this.element.closest("form");
13
+
14
+ // Choices.js has a bug where the options disappear when the form is reset.
15
+ // More info: https://github.com/Choices-js/Choices/issues/1053
16
+ form?.addEventListener("reset", () => {
17
+ choices.destroy();
18
+ choices.init();
19
+ });
11
20
  }
12
21
  }
@@ -1,5 +1,5 @@
1
1
  module Anchor
2
2
  module ViewComponents
3
- VERSION = "0.34.0".freeze
3
+ VERSION = "0.34.1".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anchor_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.34.0
4
+ version: 0.34.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Buoy Software
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-22 00:00:00.000000000 Z
11
+ date: 2023-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails