@pageboard/html 0.12.21 → 0.12.23
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.
- package/package.json +1 -1
- package/ui/form.js +7 -5
package/package.json
CHANGED
package/ui/form.js
CHANGED
|
@@ -352,16 +352,18 @@ class HTMLElementForm extends Page.create(HTMLFormElement) {
|
|
|
352
352
|
.map(input => input.presubmit(state))
|
|
353
353
|
);
|
|
354
354
|
|
|
355
|
-
const
|
|
356
|
-
scope.$request = form.read(true);
|
|
355
|
+
const request = form.read(true);
|
|
357
356
|
form.disable();
|
|
358
357
|
|
|
359
358
|
const res = await state.fetch(form.method, Page.format({
|
|
360
359
|
pathname: form.getAttribute('action'),
|
|
361
360
|
query: state.query
|
|
362
|
-
}),
|
|
361
|
+
}), request).catch(err => err);
|
|
362
|
+
|
|
363
|
+
const scope = state.scope.copy();
|
|
364
|
+
if (res?.grants) state.scope.$grants = res.grants;
|
|
365
|
+
scope.$request = request;
|
|
363
366
|
|
|
364
|
-
if (res?.grants) scope.$grants = res.grants;
|
|
365
367
|
scope.$response = res;
|
|
366
368
|
scope.$status = res.status;
|
|
367
369
|
form.enable();
|
|
@@ -433,7 +435,7 @@ HTMLSelectElement.prototype.reset = function () {
|
|
|
433
435
|
for (let i = 0; i < this.options.length; i++) this.options[i].selected = false;
|
|
434
436
|
};
|
|
435
437
|
|
|
436
|
-
HTMLInputElement.prototype.fill = function (val) {
|
|
438
|
+
HTMLButtonElement.prototype.fill = HTMLInputElement.prototype.fill = function (val) {
|
|
437
439
|
if (val == null) val = "";
|
|
438
440
|
if (this.type == "radio" || this.type == "checkbox") {
|
|
439
441
|
if (Array.isArray(val) && val.length == 0 && this.value == "") {
|