lostcoords-ui 0.14.6 → 0.14.7
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 +4 -4
- data/README.md +8 -0
- data/app/javascript/lostcoords/ui/helpers/dialog.js +8 -6
- data/lib/lostcoords/ui/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8e59511fee6edfa9e200f7b2561e8937d9d17c3884690db48e153346031fb54b
|
|
4
|
+
data.tar.gz: af8f42618286ed51b91f7dfcfe9f97cbf8f44bf24472a1ca1e2bb5eea603a3e6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8867f7a32ba7c848d3d908eabdd3bb326ae482ff3856faba090fbc3db0999f2a25c50133f5ebd3a057e7bbd0e026a926f8198f02fd0733ebd7260e5b87947398
|
|
7
|
+
data.tar.gz: 0c7ebba325be9b795f36d5dbe6ec20ca6fc851fe09069c231c78218fa78c0402413312b31a5a6d7831768f45b4951df7b22e8df6c9bb4ed7f232ccec4d2221af
|
data/README.md
CHANGED
|
@@ -170,6 +170,14 @@ Omit `only` to register every library controller. Unknown identifiers raise befo
|
|
|
170
170
|
registered, and repeated calls on the same application keep later overrides, so register defaults
|
|
171
171
|
before application overrides.
|
|
172
172
|
|
|
173
|
+
## Changes in 0.14.7
|
|
174
|
+
|
|
175
|
+
Nothing needs an edit. Fixed:
|
|
176
|
+
|
|
177
|
+
- **Focus also returns when the host removes the dialog as it closes.** Such a caller unregisters before
|
|
178
|
+
the `close` event arrives, which is where 0.14.6 returned focus, so Safari still left it on the page.
|
|
179
|
+
Focus now settles when a closed dialog is unregistered.
|
|
180
|
+
|
|
173
181
|
## Changes in 0.14.6
|
|
174
182
|
|
|
175
183
|
Nothing needs an edit. Fixed:
|
|
@@ -66,14 +66,12 @@ export function registerDialog(
|
|
|
66
66
|
if (!inside) close(event)
|
|
67
67
|
}
|
|
68
68
|
// A dialog closed and shown again in the same task fires close while it is already open again.
|
|
69
|
-
// By now the browser has handed focus back to what had it before the dialog opened, if
|
|
70
|
-
// anything had.
|
|
71
69
|
const unregisterOnClose = () => {
|
|
72
|
-
if (dialog.open)
|
|
73
|
-
unregister()
|
|
74
|
-
returnFocus(opener, dialog)
|
|
75
|
-
settleFocus()
|
|
70
|
+
if (!dialog.open) unregister()
|
|
76
71
|
}
|
|
72
|
+
// A closed dialog has handed focus back to what had it before it opened, if anything had. A
|
|
73
|
+
// caller that removes the dialog as it closes unregisters before the close event arrives, so
|
|
74
|
+
// focus settles here and not in that event.
|
|
77
75
|
const unregister = () => {
|
|
78
76
|
if (registrations.get(dialog) !== unregister) return
|
|
79
77
|
registrations.delete(dialog)
|
|
@@ -81,6 +79,10 @@ export function registerDialog(
|
|
|
81
79
|
dialog.removeEventListener("close", unregisterOnClose)
|
|
82
80
|
dialog.removeEventListener("click", closeOnBackdrop)
|
|
83
81
|
unregisterDismissable()
|
|
82
|
+
if (dialog.open) return
|
|
83
|
+
|
|
84
|
+
returnFocus(opener, dialog)
|
|
85
|
+
settleFocus()
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
registrations.set(dialog, unregister)
|