aw-wizard-forms 4.11.0 → 4.13.0

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.
@@ -1317,6 +1317,9 @@ class KeyboardController {
1317
1317
  if (isTextarea && this._config.blockEnterOnTextarea) {
1318
1318
  return;
1319
1319
  }
1320
+ if (activeElement?.tagName === "BUTTON") {
1321
+ return;
1322
+ }
1320
1323
  if (this._config.onEnter) {
1321
1324
  e2.preventDefault();
1322
1325
  this._config.onEnter();
@@ -1501,6 +1504,7 @@ let WizardForm = class extends i {
1501
1504
  this.autoAdvance = true;
1502
1505
  this.hideBack = true;
1503
1506
  this.submitOnStep = false;
1507
+ this.noAutofocus = false;
1504
1508
  this._steps = [];
1505
1509
  this._currentStep = 1;
1506
1510
  this._totalSteps = 0;
@@ -1674,6 +1678,7 @@ let WizardForm = class extends i {
1674
1678
  }
1675
1679
  this._steps.forEach((step, index) => {
1676
1680
  step.step = index + 1;
1681
+ step.noAutofocus = this.noAutofocus;
1677
1682
  });
1678
1683
  this._totalSteps = this._steps.length;
1679
1684
  this._stateController.setTotalSteps(this._totalSteps);
@@ -2112,6 +2117,9 @@ __decorateClass$g([
2112
2117
  __decorateClass$g([
2113
2118
  n2({ type: Boolean, attribute: "submit-on-step" })
2114
2119
  ], WizardForm.prototype, "submitOnStep", 2);
2120
+ __decorateClass$g([
2121
+ n2({ type: Boolean, attribute: "no-autofocus" })
2122
+ ], WizardForm.prototype, "noAutofocus", 2);
2115
2123
  __decorateClass$g([
2116
2124
  r()
2117
2125
  ], WizardForm.prototype, "_steps", 2);
@@ -2230,6 +2238,7 @@ let WfStep = class extends i {
2230
2238
  this.direction = "forward";
2231
2239
  this.leaving = false;
2232
2240
  this.skipIf = "";
2241
+ this.noAutofocus = false;
2233
2242
  this._fields = [];
2234
2243
  }
2235
2244
  render() {
@@ -2272,6 +2281,9 @@ let WfStep = class extends i {
2272
2281
  * Focus the first focusable field in this step
2273
2282
  */
2274
2283
  _focusFirstField() {
2284
+ if (this.noAutofocus) {
2285
+ return;
2286
+ }
2275
2287
  requestAnimationFrame(() => {
2276
2288
  for (const el of this.children) {
2277
2289
  const focusable = this._findFocusable(el);
@@ -2420,6 +2432,9 @@ __decorateClass$f([
2420
2432
  __decorateClass$f([
2421
2433
  n2({ type: String, attribute: "data-skip-if" })
2422
2434
  ], WfStep.prototype, "skipIf", 2);
2435
+ __decorateClass$f([
2436
+ n2({ type: Boolean, attribute: "no-autofocus" })
2437
+ ], WfStep.prototype, "noAutofocus", 2);
2423
2438
  __decorateClass$f([
2424
2439
  r()
2425
2440
  ], WfStep.prototype, "_fields", 2);
@@ -5546,8 +5561,9 @@ let WfSelect = class extends FormInputBase {
5546
5561
  }
5547
5562
  break;
5548
5563
  case "Escape":
5549
- e2.preventDefault();
5550
5564
  if (this._open) {
5565
+ e2.preventDefault();
5566
+ e2.stopPropagation();
5551
5567
  this._close();
5552
5568
  this.shadowRoot?.querySelector(".wf-select-trigger")?.focus();
5553
5569
  }