ultimate_turbo_modal 3.1.2 → 3.2.1

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: c4d5ac23c5a9f60d8106bbbc0298d5c9077adf2fff733d650c69b64cfca43fc0
4
- data.tar.gz: c49fce6b629d85895271d5ed1feca395ffeb715652269705bab0575763323ebe
3
+ metadata.gz: f0c59204e8c87cee87fc85083ef4147930a7a493b5d9c6a8ddf7e1ac76f04359
4
+ data.tar.gz: 92c975e4676ec8ae2ae953be97f6beea70d2aa3d90b6403564af08950710a058
5
5
  SHA512:
6
- metadata.gz: f8d81256366eb343f6c67806ff635a818fe9660d288189f93ed37d21f03e10252f346578b50cdab320a62fc956f33ac32cd4c2fbbaa0d88bc0cd27cc8ddc1ef3
7
- data.tar.gz: dd4ad52607db65e05ee7cdd9b2201a6d3190c2217d78ddf88391fa79040d9008eb4e20b090b4997855fc7c53e0a36327c2836af83349973b921dced7e41d2e47
6
+ metadata.gz: 918fac0dfe7519413443eac794e82b31d8014ecdbaae3279baeb0474fa00f2445b59c57f249ff35f7e5bcc0ab6c3dd6f91fecdaf3e30e34c78326b2d02e25082
7
+ data.tar.gz: 6cf8a3e810da824c8bb2cf6eb1f5c4fc9ef75671dbae67486289a927599c2c3984fa5d046fa2ac17562e78db63635145016bb4a0f1d46441b26e44c7b2d44b53
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [3.2.1] - 2026-05-07
4
+
5
+ - Fixed drawers closing abruptly when pressing Escape after dismissing a modal opened from inside the drawer.
6
+ - Fixed `inside_modal?` returning false when navigating between pages inside an open modal or drawer.
7
+
8
+ ## [3.2.0] - 2026-05-05
9
+
10
+ - Links and forms inside a drawer can now use `data-turbo-frame="modal"` to open a stacked modal — the same partial works inside or outside a drawer with no changes.
11
+ - Fixed scroll-lock not releasing after a same-page morph reconnected the modal controller, which could leave the page padded and right-anchored fixed elements offset until refresh.
12
+
3
13
  ## [3.1.2] - 2026-05-01
4
14
 
5
15
  - Fixed page content shifting right when a modal or drawer opens.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ultimate_turbo_modal (3.1.2)
4
+ ultimate_turbo_modal (3.2.1)
5
5
  actionpack (>= 8.0)
6
6
  activesupport (>= 8.0)
7
7
  phlex-rails (>= 2.0)
data/README.md CHANGED
@@ -205,28 +205,24 @@ Link to it the same way as a modal:
205
205
 
206
206
  ## Opening a Modal from a Drawer
207
207
 
208
- You can open a regular modal that stacks on top of an open drawer. This is built in — no setup or opt-in required.
209
-
210
- Inside any drawer, link to a modal action with `data-turbo-frame="drawer-modal"`:
208
+ You don't need to do anything special. Use `data-turbo-frame="modal"` like you would anywhere else, and UTMR handles the rest:
211
209
 
212
210
  ```erb
213
211
  <%= drawer(title: "Notifications") do %>
214
212
  <p>Activity list here…</p>
215
213
  <%= link_to "Edit preferences",
216
214
  edit_preferences_path,
217
- data: { turbo_frame: "drawer-modal" } %>
215
+ data: { turbo_frame: "modal" } %>
218
216
  <% end %>
219
217
  ```
220
218
 
221
- The destination is rendered with the same `modal()` helper you use elsewhere:
222
-
223
219
  ```erb
224
220
  <%= modal(title: "Notification preferences") do %>
225
221
  <p>Form here…</p>
226
222
  <% end %>
227
223
  ```
228
224
 
229
- The gem detects the request and renders the modal into a stacked `<dialog>` that sits visually on top of the drawer.
225
+ The same partial works inside a drawer or out outside, it opens a regular modal; inside, it stacks on top of the drawer.
230
226
 
231
227
  ### Behavior
232
228
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.2
1
+ 3.2.1
@@ -4,8 +4,10 @@ module UltimateTurboModal::Helpers
4
4
  module ControllerHelper
5
5
  extend ActiveSupport::Concern
6
6
 
7
+ MODAL_FRAME_IDS = %w[modal modal-inner drawer-modal modal-inner-stacked].freeze
8
+
7
9
  def inside_modal?
8
- request.headers["Turbo-Frame"] == "modal"
10
+ MODAL_FRAME_IDS.include?(request.headers["Turbo-Frame"])
9
11
  end
10
12
 
11
13
  included do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultimate_turbo_modal
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carl Mercier