rails_modal_manager 1.0.3 → 1.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 131bae5631f7154fb171bbb06487f4a221a433f87cee8e5a190fc85bdc0133f3
4
- data.tar.gz: f02669306e1b572aa6b3e017f4e946ebcf1d750dc655a40183270b56bdf2ee77
3
+ metadata.gz: c2f67902f2a1a7d3f98a0318b84ebd2adeeec5d1d8067ead263ea394fc76d64a
4
+ data.tar.gz: 88ab650eaaf8eb145a1fe7844dec22acf2e0e61381e2e1217ee172fea6bee283
5
5
  SHA512:
6
- metadata.gz: dae81bc1a99127097436b4af78931f35644ad046dba68521ba6f057a877fa5e117a8d0e2793c65f04a364e664e04b5927b878fe6fe02792880e559d650f0cc7b
7
- data.tar.gz: 80a7d578b8132988c990a70d9492a541ff5fe8c37d02f7af2616731c82eb080276d3df9d726c507cb09ae2bead8c2a70864639ab54ce604c2c7b4a3da06d5813
6
+ metadata.gz: 120b2415ca136f031f10805151f948e6616754c2e6c07c303fb115f9f87f56f66037688f93fbfd95398a3612d79f84f0c398e006654f434222b5304cfb1fa3d8
7
+ data.tar.gz: 29edd0abdbc5cf321eb818366a86998e18cdc3dce2b39cf37e5a4ba75866224e8b8750adbc32548167ddefa217302a86a518de6610eeb6dbe659b397791cb063
@@ -90,7 +90,7 @@ export default class extends Controller {
90
90
  openValueChanged(value, previousValue) {
91
91
  if (value && !previousValue) {
92
92
  this.open()
93
- } else if (!value && previousValue) {
93
+ } else if (!value && previousValue && !this._closingProgrammatically) {
94
94
  this.close('programmatic')
95
95
  }
96
96
  }
@@ -347,6 +347,12 @@ export default class extends Controller {
347
347
  if (overlay) overlay.classList.remove('rmm-active')
348
348
 
349
349
  setTimeout(() => {
350
+ // Reset openValue to false so modal can be reopened
351
+ // Use a flag to prevent openValueChanged from triggering close again
352
+ this._closingProgrammatically = true
353
+ this.openValue = false
354
+ this._closingProgrammatically = false
355
+
350
356
  if (callback) callback()
351
357
  }, this.animationDurationValue)
352
358
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsModalManager
4
- VERSION = "1.0.3"
4
+ VERSION = "1.0.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_modal_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - reshacs