stimulus-library 0.9.3 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  import { BaseController } from "../../utilities/base_controller";
2
2
  import clamp from "lodash-es/clamp";
3
3
  import { useCollectionEventListener } from "../../mixins/use_event_listener";
4
+ import { installClassMethods } from "../../mixins/install_class_methods";
4
5
  export class TabsController extends BaseController {
5
6
  static values = { currentTab: Number, equalize: Boolean };
6
7
  static targets = ["link", "content"];
@@ -19,6 +20,7 @@ export class TabsController extends BaseController {
19
20
  }
20
21
  connect() {
21
22
  useCollectionEventListener(this, this.linkTargets, "click", this.switchTabs);
23
+ installClassMethods(this);
22
24
  if (this._equalize) {
23
25
  this._setMinHeight();
24
26
  }
@@ -31,7 +33,7 @@ export class TabsController extends BaseController {
31
33
  currentTabValueChanged() {
32
34
  let index = this._currentTab;
33
35
  index = this._clampIndex(index);
34
- this._selectTab(index);
36
+ requestAnimationFrame(() => this._selectTab(index));
35
37
  }
36
38
  _selectTab(index) {
37
39
  index = this._clampIndex(index);
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "ruby on rails",
10
10
  "ruby-on-rails"
11
11
  ],
12
- "version": "0.9.3",
12
+ "version": "0.9.4",
13
13
  "license": "MIT",
14
14
  "author": {
15
15
  "name": "Sub-Xaero",