@pageboard/html 0.12.25 → 0.12.27

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/ui/form.js +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pageboard/html",
3
- "version": "0.12.25",
3
+ "version": "0.12.27",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "repository": {
package/ui/form.js CHANGED
@@ -138,10 +138,10 @@ class HTMLElementForm extends Page.create(HTMLFormElement) {
138
138
  paint(state) {
139
139
  // ?submit=<name> for auto-submit
140
140
  // WORKAROUND use Page instead of state
141
- const name = Page.query.submit;
141
+ const name = state.query.submit;
142
142
  if (!name || name != this.name) return;
143
143
  // make sure to not resubmit in case of self-redirection
144
- delete Page.query.submit;
144
+ delete state.query.submit;
145
145
  state.finish(() => {
146
146
  if (state.status != 200) return;
147
147
  this.dispatchEvent(new Event('submit', {
@@ -455,6 +455,8 @@ HTMLButtonElement.prototype.fill = HTMLInputElement.prototype.fill = function (v
455
455
  if (this.type == "file") {
456
456
  if (val === '') this.removeAttribute('value');
457
457
  else this.setAttribute('value', val);
458
+ } else if (this.type == "submit" && this.value == '') {
459
+ this.value = val;
458
460
  } else {
459
461
  this.value = val;
460
462
  }