unpoly-rails 3.2.0 → 3.2.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: 8aad822814c364e6c003135865e0601e1174b81567228b876be4147dfb376935
4
- data.tar.gz: '0419c160f2820bfe41ae4a462ec1995d213fde77f29af52ff6245611e7256914'
3
+ metadata.gz: 79a9c4869d0ec45ad05907ff229067ef43891b59936aa069fd58551c673e3a77
4
+ data.tar.gz: 89fe1f52966c22a19f7bf57db742ca1a0c14362f39a5755556be18e5d2af8c6c
5
5
  SHA512:
6
- metadata.gz: dc005b41d495e97382b7aa8e358219df7419cfc74769324481881d1e298cfdf4f90e6f38600a2b8eb2ea8fd48b6be0e085662575ecbddf88faafa07319cbc985
7
- data.tar.gz: be6555351d6eae5e6bc5ef41e224ed586c798cdc8d27db4977d460d2f10179ad1cdc3a9e8992893e0125124d39d93af8813e09be97506affe21e382f64b0ddad
6
+ metadata.gz: 56e2152fe2c5c83d18ea818127d10abbb951649a134d54ecfe8905d8e97580fa9961f026fce11cff3f3ec835ab0d4eecb9755e1ed4131c1ceb0c93deb28062da
7
+ data.tar.gz: b50e4f53131c9a1cbd5efa0a219dc3272a7bfd3aeae1404510b38724fdbc9e9af314e3e5655d1f0a2ec2e32c0e90a438388c36eb04df73a7816c3e1d53cf6df4
data/README.md CHANGED
@@ -494,7 +494,7 @@ What you still need to do manually
494
494
 
495
495
  ### Failed form submissions must return a non-200 status code
496
496
 
497
- Unpoly lets you submit forms via AJAX by using the [`form[up-follow]`](https://unpoly.com/form-up-submit) selector or [`up.submit()`](https://unpoly.com/up.submit) function.
497
+ Unpoly lets you submit forms via AJAX by using the [`form[up-submit]`](https://unpoly.com/form-up-submit) selector or [`up.submit()`](https://unpoly.com/up.submit) function.
498
498
 
499
499
  For Unpoly to be able to detect a failed form submission,
500
500
  the form must be re-rendered with a non-200 HTTP status code.
@@ -6,5 +6,5 @@ up-popup .container,
6
6
  up-popup .container-fluid {
7
7
  padding-left: 0;
8
8
  padding-right: 0;
9
- max-width: none; }
10
-
9
+ max-width: none;
10
+ }
@@ -1,2 +1 @@
1
1
  up-modal .container,up-modal .container-fluid,up-drawer .container,up-drawer .container-fluid,up-popup .container,up-popup .container-fluid{padding-left:0;padding-right:0;max-width:none}
2
-
@@ -6,5 +6,5 @@ up-popup .container,
6
6
  up-popup .container-fluid {
7
7
  padding-left: 0;
8
8
  padding-right: 0;
9
- max-width: none; }
10
-
9
+ max-width: none;
10
+ }
@@ -1,2 +1 @@
1
1
  up-modal .container,up-modal .container-fluid,up-drawer .container,up-drawer .container-fluid,up-popup .container,up-popup .container-fluid{padding-left:0;padding-right:0;max-width:none}
2
-
@@ -6,5 +6,5 @@ up-popup .container,
6
6
  up-popup .container-fluid {
7
7
  padding-left: 0;
8
8
  padding-right: 0;
9
- max-width: none; }
10
-
9
+ max-width: none;
10
+ }
@@ -1,2 +1 @@
1
1
  up-modal .container,up-modal .container-fluid,up-drawer .container,up-drawer .container-fluid,up-popup .container,up-popup .container-fluid{padding-left:0;padding-right:0;max-width:none}
2
-
@@ -1,17 +1,19 @@
1
1
  [hidden][hidden] {
2
- display: none !important; }
3
-
2
+ display: none !important;
3
+ }
4
4
  up-wrapper {
5
- display: inline-block; }
6
-
5
+ display: inline-block;
6
+ }
7
7
  up-bounds {
8
- position: absolute; }
8
+ position: absolute;
9
+ }
9
10
 
10
11
  .up-focusable-content:focus, .up-focusable-content:focus-visible {
11
- outline: 0; }
12
-
12
+ outline: 0;
13
+ }
13
14
  .up-request-loader {
14
- display: none; }
15
+ display: none;
16
+ }
15
17
 
16
18
  up-progress-bar {
17
19
  position: fixed;
@@ -19,136 +21,164 @@ up-progress-bar {
19
21
  left: 0;
20
22
  z-index: 999999999;
21
23
  height: 3px;
22
- background-color: #007bff; }
23
-
24
+ background-color: #007bff;
25
+ }
24
26
  up-focus-trap {
25
27
  position: fixed;
26
28
  top: 0;
27
29
  left: 0;
28
30
  width: 0;
29
- height: 0; }
31
+ height: 0;
32
+ }
30
33
 
31
- up-modal, up-drawer, up-cover, up-modal-backdrop, up-drawer-backdrop, up-modal-viewport, up-drawer-viewport, up-cover-viewport {
34
+ up-cover-viewport, up-drawer-viewport, up-modal-viewport, up-drawer-backdrop, up-modal-backdrop, up-cover, up-drawer, up-modal {
32
35
  top: 0;
33
36
  left: 0;
34
37
  bottom: 0;
35
- right: 0; }
38
+ right: 0;
39
+ }
36
40
 
37
- up-modal-box, up-drawer-box {
38
- box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.3); }
41
+ up-drawer-box, up-modal-box {
42
+ box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.3);
43
+ }
39
44
 
40
45
  up-popup {
41
- box-shadow: 0 0 4px rgba(0, 0, 0, 0.3); }
46
+ box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
47
+ }
42
48
 
43
- up-modal:focus, up-drawer:focus, up-cover:focus, up-modal-box:focus, up-drawer-box:focus, up-cover-box:focus, up-popup:focus, up-modal:focus-visible, up-drawer:focus-visible, up-cover:focus-visible, up-modal-box:focus-visible, up-drawer-box:focus-visible, up-cover-box:focus-visible, up-popup:focus-visible {
44
- outline: none; }
49
+ up-popup:focus, up-cover-box:focus, up-drawer-box:focus, up-modal-box:focus, up-cover:focus, up-drawer:focus, up-modal:focus, up-popup:focus-visible, up-cover-box:focus-visible, up-drawer-box:focus-visible, up-modal-box:focus-visible, up-cover:focus-visible, up-drawer:focus-visible, up-modal:focus-visible {
50
+ outline: none;
51
+ }
45
52
 
46
- up-modal, up-drawer, up-cover {
53
+ up-cover, up-drawer, up-modal {
47
54
  z-index: 2000;
48
- position: fixed; }
55
+ position: fixed;
56
+ }
49
57
 
50
- up-modal-backdrop, up-drawer-backdrop {
58
+ up-drawer-backdrop, up-modal-backdrop {
51
59
  position: absolute;
52
- background: rgba(0, 0, 0, 0.4); }
60
+ background: rgba(0, 0, 0, 0.4);
61
+ }
53
62
 
54
- up-modal-viewport, up-drawer-viewport, up-cover-viewport {
63
+ up-cover-viewport, up-drawer-viewport, up-modal-viewport {
55
64
  position: absolute;
56
65
  overflow-y: scroll;
57
66
  overflow-x: hidden;
58
67
  overscroll-behavior: contain;
59
68
  display: flex;
60
69
  align-items: flex-start;
61
- justify-content: center; }
70
+ justify-content: center;
71
+ }
62
72
 
63
- up-modal-box, up-drawer-box, up-cover-box, up-popup {
73
+ up-popup, up-cover-box, up-drawer-box, up-modal-box {
64
74
  position: relative;
65
75
  box-sizing: border-box;
66
76
  max-width: 100%;
67
77
  background-color: #fff;
68
78
  padding: 20px;
69
- overflow-x: hidden; }
79
+ overflow-x: hidden;
80
+ }
70
81
 
71
- up-modal-content, up-drawer-content, up-cover-content, up-popup-content {
72
- display: block; }
82
+ up-popup-content, up-cover-content, up-drawer-content, up-modal-content {
83
+ display: block;
84
+ }
73
85
 
74
86
  up-popup {
75
- z-index: 1000; }
87
+ z-index: 1000;
88
+ }
76
89
 
77
- up-modal-dismiss, up-drawer-dismiss, up-cover-dismiss, up-popup-dismiss {
90
+ up-popup-dismiss, up-cover-dismiss, up-drawer-dismiss, up-modal-dismiss {
78
91
  color: #888;
79
92
  position: absolute;
80
93
  top: 10px;
81
94
  right: 10px;
82
95
  font-size: 1.7rem;
83
- line-height: 0.5; }
96
+ line-height: 0.5;
97
+ }
84
98
 
85
99
  up-modal[nesting="0"] up-modal-viewport {
86
- padding: 25px 15px; }
87
-
100
+ padding: 25px 15px;
101
+ }
88
102
  up-modal[nesting="1"] up-modal-viewport {
89
- padding: 50px 30px; }
90
-
103
+ padding: 50px 30px;
104
+ }
91
105
  up-modal[nesting="2"] up-modal-viewport {
92
- padding: 75px 45px; }
93
-
106
+ padding: 75px 45px;
107
+ }
94
108
  up-modal[nesting="3"] up-modal-viewport {
95
- padding: 100px 60px; }
96
-
109
+ padding: 100px 60px;
110
+ }
97
111
  up-modal[nesting="4"] up-modal-viewport {
98
- padding: 125px 75px; }
112
+ padding: 125px 75px;
113
+ }
99
114
 
100
115
  up-modal[size=small] up-modal-box {
101
- width: 350px; }
102
-
116
+ width: 350px;
117
+ }
103
118
  up-modal[size=medium] up-modal-box {
104
- width: 650px; }
105
-
119
+ width: 650px;
120
+ }
106
121
  up-modal[size=large] up-modal-box {
107
- width: 1000px; }
108
-
122
+ width: 1000px;
123
+ }
109
124
  up-modal[size=grow] up-modal-box {
110
- width: auto; }
111
-
125
+ width: auto;
126
+ }
112
127
  up-modal[size=full] up-modal-box {
113
- width: 100%; }
128
+ width: 100%;
129
+ }
114
130
 
115
131
  up-drawer-viewport {
116
- justify-content: flex-start; }
117
- up-drawer[position=right] up-drawer-viewport {
118
- justify-content: flex-end; }
132
+ justify-content: flex-start;
133
+ }
134
+ up-drawer[position=right] up-drawer-viewport {
135
+ justify-content: flex-end;
136
+ }
119
137
 
120
138
  up-drawer-box {
121
- min-height: 100vh; }
122
- up-drawer[size=small] up-drawer-box {
123
- width: 150px; }
124
- up-drawer[size=medium] up-drawer-box {
125
- width: 340px; }
126
- up-drawer[size=large] up-drawer-box {
127
- width: 600px; }
128
- up-drawer[size=grow] up-drawer-box {
129
- width: auto; }
130
- up-drawer[size=full] up-drawer-box {
131
- width: 100%; }
139
+ min-height: 100vh;
140
+ }
141
+ up-drawer[size=small] up-drawer-box {
142
+ width: 150px;
143
+ }
144
+ up-drawer[size=medium] up-drawer-box {
145
+ width: 340px;
146
+ }
147
+ up-drawer[size=large] up-drawer-box {
148
+ width: 600px;
149
+ }
150
+ up-drawer[size=grow] up-drawer-box {
151
+ width: auto;
152
+ }
153
+ up-drawer[size=full] up-drawer-box {
154
+ width: 100%;
155
+ }
132
156
 
133
157
  up-cover-box {
134
158
  width: 100%;
135
159
  min-height: 100vh;
136
- padding: 0; }
160
+ padding: 0;
161
+ }
137
162
 
138
163
  up-popup {
139
164
  padding: 15px;
140
- text-align: left; }
141
- up-popup[size=small] {
142
- width: 180px; }
143
- up-popup[size=medium] {
144
- width: 300px; }
145
- up-popup[size=large] {
146
- width: 550px; }
147
- up-popup[size=grow] up-popup {
148
- width: auto; }
149
- up-popup[size=full] up-popup {
150
- width: 100%; }
151
-
165
+ text-align: left;
166
+ }
167
+ up-popup[size=small] {
168
+ width: 180px;
169
+ }
170
+ up-popup[size=medium] {
171
+ width: 300px;
172
+ }
173
+ up-popup[size=large] {
174
+ width: 550px;
175
+ }
176
+ up-popup[size=grow] up-popup {
177
+ width: auto;
178
+ }
179
+ up-popup[size=full] up-popup {
180
+ width: 100%;
181
+ }
152
182
  [up-href], [up-clickable] {
153
- cursor: pointer; }
154
-
183
+ cursor: pointer;
184
+ }
@@ -5,7 +5,7 @@
5
5
  /***/ (() => {
6
6
 
7
7
  window.up = {
8
- version: '3.2.0'
8
+ version: '3.2.1'
9
9
  };
10
10
 
11
11
 
@@ -834,10 +834,6 @@ up.util = (function () {
834
834
  /***/ (() => {
835
835
 
836
836
  up.error = (function () {
837
- function emitGlobal(error) {
838
- const { message } = error;
839
- up.emit(window, 'error', { message, error, log: false });
840
- }
841
837
  function fail(...args) {
842
838
  throw new up.Error(args);
843
839
  }
@@ -845,17 +841,27 @@ up.error = (function () {
845
841
  return (typeof error !== 'object') || ((error.name !== 'AbortError') && !(error instanceof up.RenderResult) && !(error instanceof up.Response));
846
842
  }
847
843
  function muteUncriticalRejection(promise) {
848
- return promise.catch(function (reason) {
849
- if (isCritical(reason)) {
850
- throw reason;
851
- }
852
- });
844
+ return promise.catch(rethrowCritical);
845
+ }
846
+ function muteUncriticalSync(block) {
847
+ try {
848
+ return block();
849
+ }
850
+ catch (e) {
851
+ rethrowCritical(e);
852
+ }
853
+ }
854
+ function rethrowCritical(value) {
855
+ if (isCritical(value)) {
856
+ throw value;
857
+ }
853
858
  }
854
859
  return {
855
860
  fail,
856
- emitGlobal,
861
+ rethrowCritical,
857
862
  isCritical,
858
863
  muteUncriticalRejection,
864
+ muteUncriticalSync,
859
865
  };
860
866
  })();
861
867
  up.fail = up.error.fail;
@@ -939,7 +945,7 @@ up.element = (function () {
939
945
  }
940
946
  function isInSubtree(root, selectorOrElement) {
941
947
  const element = getOne(selectorOrElement);
942
- return root.contains(element);
948
+ return Node.prototype.contains.call(root, element);
943
949
  }
944
950
  function ancestor(element, selector) {
945
951
  let parentElement = element.parentElement;
@@ -1182,7 +1188,7 @@ up.element = (function () {
1182
1188
  }
1183
1189
  }
1184
1190
  function classSelector(klass) {
1185
- klass = klass.replace(/:/g, '\\:');
1191
+ klass = klass.replace(/[^\w-]/g, '\\$&');
1186
1192
  return `.${klass}`;
1187
1193
  }
1188
1194
  function createBrokenDocumentFromHTML(html) {
@@ -1899,7 +1905,7 @@ up.RenderJob = (_a = class RenderJob {
1899
1905
  if (result instanceof up.RenderResult) {
1900
1906
  if (!result.none)
1901
1907
  (_b = (_a = result.options).onRendered) === null || _b === void 0 ? void 0 : _b.call(_a, result);
1902
- result.finished.then(result.options.onFinished);
1908
+ result.finished.then(result.options.onFinished, u.noop);
1903
1909
  return true;
1904
1910
  }
1905
1911
  }
@@ -2093,8 +2099,8 @@ up.Change.OpenLayer = class OpenLayer extends up.Change.Addition {
2093
2099
  if (this.emitOpenEvent().defaultPrevented) {
2094
2100
  throw new up.Aborted('Open event was prevented');
2095
2101
  }
2096
- this.baseLayer.peel();
2097
2102
  this.layer = this.buildLayer();
2103
+ this.baseLayer.peel({ history: !this.layer.history });
2098
2104
  up.layer.stack.push(this.layer);
2099
2105
  this.layer.createElements(this.content);
2100
2106
  this.layer.setupHandlers();
@@ -2235,7 +2241,7 @@ up.Change.UpdateLayer = (_a = class UpdateLayer extends up.Change.Addition {
2235
2241
  up.viewport.saveFocus({ layer: this.layer });
2236
2242
  }
2237
2243
  if (this.options.peel) {
2238
- this.layer.peel();
2244
+ this.layer.peel({ history: !this.hasHistory() });
2239
2245
  }
2240
2246
  if (this.options.abort !== false) {
2241
2247
  up.fragment.abort(this.getFragments(), { reason: 'Fragment is being replaced' });
@@ -2499,7 +2505,7 @@ up.Change.UpdateLayer = (_a = class UpdateLayer extends up.Change.Addition {
2499
2505
  const u = up.util;
2500
2506
  up.Change.CloseLayer = class CloseLayer extends up.Change.Removal {
2501
2507
  constructor(options) {
2502
- var _a;
2508
+ var _a, _b;
2503
2509
  super(options);
2504
2510
  this.verb = options.verb;
2505
2511
  this.layer = up.layer.get(options);
@@ -2507,6 +2513,7 @@ up.Change.CloseLayer = class CloseLayer extends up.Change.Removal {
2507
2513
  this.value = options.value;
2508
2514
  this.preventable = (_a = options.preventable) !== null && _a !== void 0 ? _a : true;
2509
2515
  this.response = options.response;
2516
+ this.history = (_b = options.history) !== null && _b !== void 0 ? _b : true;
2510
2517
  }
2511
2518
  execute() {
2512
2519
  if (!this.layer.isOpen()) {
@@ -2520,7 +2527,9 @@ up.Change.CloseLayer = class CloseLayer extends up.Change.Removal {
2520
2527
  const { parent } = this.layer;
2521
2528
  this.layer.peel();
2522
2529
  this.layer.stack.remove(this.layer);
2523
- parent.restoreHistory();
2530
+ if (this.history) {
2531
+ parent.restoreHistory();
2532
+ }
2524
2533
  this.handleFocus(parent);
2525
2534
  this.layer.teardownHandlers();
2526
2535
  this.layer.destroyElements(this.options);
@@ -3004,7 +3013,6 @@ up.CompilerPass = class CompilerPass {
3004
3013
  catch (error) {
3005
3014
  this.errors.push(error);
3006
3015
  up.log.error('up.hello()', 'While compiling %o: %o', elementOrElements, error);
3007
- up.error.emitGlobal(error);
3008
3016
  }
3009
3017
  }
3010
3018
  destructorPresence(result) {
@@ -3177,7 +3185,6 @@ up.DestructorPass = class DestructorPass {
3177
3185
  catch (error) {
3178
3186
  this.errors.push(error);
3179
3187
  up.log.error('up.destroy()', 'While destroying %o: %o', element, error);
3180
- up.error.emitGlobal(error);
3181
3188
  }
3182
3189
  }
3183
3190
  };
@@ -3349,6 +3356,9 @@ up.EventListener = class EventListener extends up.Record {
3349
3356
  const data = up.syntax.data(element);
3350
3357
  args.push(data);
3351
3358
  }
3359
+ if (this.eventType === 'click' && element.disabled) {
3360
+ return;
3361
+ }
3352
3362
  const applyCallback = this.callback.bind(element, ...args);
3353
3363
  if (this.baseLayer) {
3354
3364
  this.baseLayer.asCurrent(applyCallback);
@@ -4091,9 +4101,7 @@ up.FragmentPolling = class FragmentPolling {
4091
4101
  }
4092
4102
  onReloadFailure(reason) {
4093
4103
  this.scheduleReload();
4094
- if (up.error.isCritical(reason)) {
4095
- throw reason;
4096
- }
4104
+ up.error.rethrowCritical(reason);
4097
4105
  }
4098
4106
  onFragmentSwapped(newFragment) {
4099
4107
  this.stop();
@@ -4585,7 +4593,7 @@ up.Layer.Overlay = class Overlay extends up.Layer {
4585
4593
  parser.string('easing');
4586
4594
  parser.number('duration');
4587
4595
  parser.string('confirm');
4588
- closeFn(value, closeOptions);
4596
+ up.error.muteUncriticalSync(() => closeFn(value, closeOptions));
4589
4597
  });
4590
4598
  }
4591
4599
  registerEventCloser(eventTypes, closeFn) {
@@ -4763,13 +4771,13 @@ up.Layer.OverlayWithViewport = (_a = class OverlayWithViewport extends up.Layer.
4763
4771
  var _a;
4764
4772
  const e = up.element;
4765
4773
  up.Layer.Root = (_a = class Root extends up.Layer {
4774
+ get element() {
4775
+ return e.root;
4776
+ }
4766
4777
  constructor(options) {
4767
4778
  super(options);
4768
4779
  this.setupHandlers();
4769
4780
  }
4770
- get element() {
4771
- return e.root;
4772
- }
4773
4781
  getFirstSwappableElement() {
4774
4782
  return document.body;
4775
4783
  }
@@ -5930,27 +5938,6 @@ up.RenderResult = class RenderResult extends up.Record {
5930
5938
  var _a;
5931
5939
  const u = up.util;
5932
5940
  up.Request = (_a = class Request extends up.Record {
5933
- constructor(options) {
5934
- var _a;
5935
- super(options);
5936
- this.params = new up.Params(this.params);
5937
- if (this.wrapMethod == null) {
5938
- this.wrapMethod = up.network.config.wrapMethod;
5939
- }
5940
- this.normalize();
5941
- if ((this.target || this.layer || this.origin) && !options.basic) {
5942
- const layerLookupOptions = { origin: this.origin };
5943
- this.layer = up.layer.get(this.layer, layerLookupOptions);
5944
- this.failLayer = up.layer.get(this.failLayer || this.layer, layerLookupOptions);
5945
- this.context || (this.context = this.layer.context || {});
5946
- this.failContext || (this.failContext = this.failLayer.context || {});
5947
- this.mode || (this.mode = this.layer.mode);
5948
- this.failMode || (this.failMode = this.failLayer.mode);
5949
- }
5950
- this.deferred = u.newDeferred();
5951
- (_a = this.badResponseTime) !== null && _a !== void 0 ? _a : (this.badResponseTime = u.evalOption(up.network.config.badResponseTime, this));
5952
- this.addAutoHeaders();
5953
- }
5954
5941
  keys() {
5955
5942
  return [
5956
5943
  'method',
@@ -5993,6 +5980,27 @@ up.Request = (_a = class Request extends up.Record {
5993
5980
  builtAt: new Date(),
5994
5981
  };
5995
5982
  }
5983
+ constructor(options) {
5984
+ var _a;
5985
+ super(options);
5986
+ this.params = new up.Params(this.params);
5987
+ if (this.wrapMethod == null) {
5988
+ this.wrapMethod = up.network.config.wrapMethod;
5989
+ }
5990
+ this.normalize();
5991
+ if ((this.target || this.layer || this.origin) && !options.basic) {
5992
+ const layerLookupOptions = { origin: this.origin };
5993
+ this.layer = up.layer.get(this.layer, layerLookupOptions);
5994
+ this.failLayer = up.layer.get(this.failLayer || this.layer, layerLookupOptions);
5995
+ this.context || (this.context = this.layer.context || {});
5996
+ this.failContext || (this.failContext = this.failLayer.context || {});
5997
+ this.mode || (this.mode = this.layer.mode);
5998
+ this.failMode || (this.failMode = this.failLayer.mode);
5999
+ }
6000
+ this.deferred = u.newDeferred();
6001
+ (_a = this.badResponseTime) !== null && _a !== void 0 ? _a : (this.badResponseTime = u.evalOption(up.network.config.badResponseTime, this));
6002
+ this.addAutoHeaders();
6003
+ }
5996
6004
  get xhr() {
5997
6005
  var _a;
5998
6006
  return (_a = this._xhr) !== null && _a !== void 0 ? _a : (this._xhr = new XMLHttpRequest());
@@ -7798,6 +7806,7 @@ up.history = (function () {
7798
7806
  }
7799
7807
  function onPop(event) {
7800
7808
  trackCurrentLocation();
7809
+ let location = currentLocation();
7801
7810
  emitLocationChanged({ location, reason: 'pop', log: `Navigated to history entry ${location}` });
7802
7811
  up.viewport.saveFocus({ location: previousLocation });
7803
7812
  up.viewport.saveScroll({ location: previousLocation });
@@ -8913,8 +8922,11 @@ up.motion = (function () {
8913
8922
  function translateCSS(dx, dy) {
8914
8923
  return { transform: `translate(${dx}px, ${dy}px)` };
8915
8924
  }
8925
+ function noTranslateCSS() {
8926
+ return { transform: null };
8927
+ }
8916
8928
  function untranslatedBox(element) {
8917
- e.setStyle(element, translateCSS(0, 0));
8929
+ e.setStyle(element, noTranslateCSS());
8918
8930
  return element.getBoundingClientRect();
8919
8931
  }
8920
8932
  function registerMoveAnimations(direction, boxToTransform) {
@@ -8929,7 +8941,7 @@ up.motion = (function () {
8929
8941
  const box = untranslatedBox(element);
8930
8942
  const transform = boxToTransform(box);
8931
8943
  e.setStyle(element, transform);
8932
- return animateNow(element, translateCSS(0, 0), options);
8944
+ return animateNow(element, noTranslateCSS(), options);
8933
8945
  });
8934
8946
  }
8935
8947
  registerMoveAnimations('top', function (box) {
@@ -9733,13 +9745,13 @@ up.form = (function () {
9733
9745
  }
9734
9746
  function submittingButton(form) {
9735
9747
  const selector = submitButtonSelector();
9736
- const focusedElement = up.viewport.focusedElementWithin(form);
9737
- if (focusedElement && focusedElement.matches(selector)) {
9738
- return focusedElement;
9739
- }
9740
- else {
9741
- return e.get(form, selector);
9748
+ const focusedElement = document.activeElement;
9749
+ if (focusedElement && focusedElement.form === form) {
9750
+ if (focusedElement.matches(selector)) {
9751
+ return focusedElement;
9752
+ }
9742
9753
  }
9754
+ return e.get(form, selector);
9743
9755
  }
9744
9756
  function submitButtonSelector() {
9745
9757
  return config.submitButtonSelectors.join(',');