@aurodesignsystem-dev/auro-formkit 0.0.0-pr1604.1 → 0.0.0-pr1605.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.
Files changed (52) hide show
  1. package/components/checkbox/demo/customize.min.js +1 -1
  2. package/components/checkbox/demo/getting-started.min.js +1 -1
  3. package/components/checkbox/demo/index.min.js +1 -1
  4. package/components/checkbox/dist/index.js +1 -1
  5. package/components/checkbox/dist/registered.js +1 -1
  6. package/components/combobox/demo/customize.min.js +153 -5
  7. package/components/combobox/demo/getting-started.min.js +153 -5
  8. package/components/combobox/demo/index.min.js +153 -5
  9. package/components/combobox/dist/auro-combobox.d.ts +22 -0
  10. package/components/combobox/dist/index.js +137 -5
  11. package/components/combobox/dist/registered.js +137 -5
  12. package/components/counter/demo/customize.min.js +339 -23
  13. package/components/counter/demo/getting-started.min.js +339 -23
  14. package/components/counter/demo/index.min.js +339 -23
  15. package/components/counter/dist/counterGroupKeyboardStrategy.d.ts +1 -0
  16. package/components/counter/dist/index.js +339 -23
  17. package/components/counter/dist/registered.js +339 -23
  18. package/components/datepicker/demo/customize.min.js +94 -5
  19. package/components/datepicker/demo/getting-started.min.js +94 -5
  20. package/components/datepicker/demo/index.min.js +94 -5
  21. package/components/datepicker/dist/auro-datepicker.d.ts +7 -0
  22. package/components/datepicker/dist/index.js +94 -5
  23. package/components/datepicker/dist/registered.js +94 -5
  24. package/components/dropdown/demo/customize.min.js +44 -2
  25. package/components/dropdown/demo/getting-started.min.js +45 -3
  26. package/components/dropdown/demo/index.min.js +44 -2
  27. package/components/dropdown/dist/index.js +44 -2
  28. package/components/dropdown/dist/registered.js +44 -2
  29. package/components/form/demo/customize.min.js +634 -39
  30. package/components/form/demo/getting-started.min.js +634 -39
  31. package/components/form/demo/index.min.js +634 -39
  32. package/components/form/demo/registerDemoDeps.min.js +634 -39
  33. package/components/input/demo/customize.min.js +1 -1
  34. package/components/input/demo/getting-started.min.js +1 -1
  35. package/components/input/demo/index.min.js +1 -1
  36. package/components/input/dist/index.js +1 -1
  37. package/components/input/dist/registered.js +1 -1
  38. package/components/menu/demo/index.min.js +16 -0
  39. package/components/menu/dist/index.js +16 -0
  40. package/components/menu/dist/registered.js +16 -0
  41. package/components/radio/demo/customize.min.js +1 -1
  42. package/components/radio/demo/getting-started.min.js +1 -1
  43. package/components/radio/demo/index.min.js +1 -1
  44. package/components/radio/dist/index.js +1 -1
  45. package/components/radio/dist/registered.js +1 -1
  46. package/components/select/demo/customize.min.js +61 -3
  47. package/components/select/demo/getting-started.min.js +61 -3
  48. package/components/select/demo/index.min.js +61 -3
  49. package/components/select/dist/index.js +45 -3
  50. package/components/select/dist/registered.js +45 -3
  51. package/custom-elements.json +1521 -1491
  52. package/package.json +3 -3
@@ -1284,7 +1284,7 @@ class AuroHelpText extends i$2 {
1284
1284
  }
1285
1285
  }
1286
1286
 
1287
- var formkitVersion = '202609012101';
1287
+ var formkitVersion = '202609022200';
1288
1288
 
1289
1289
  // Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
1290
1290
  // See LICENSE in the project root for license information.
@@ -1284,7 +1284,7 @@ class AuroHelpText extends i$2 {
1284
1284
  }
1285
1285
  }
1286
1286
 
1287
- var formkitVersion = '202609012101';
1287
+ var formkitVersion = '202609022200';
1288
1288
 
1289
1289
  // Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
1290
1290
  // See LICENSE in the project root for license information.
@@ -1284,7 +1284,7 @@ class AuroHelpText extends i$2 {
1284
1284
  }
1285
1285
  }
1286
1286
 
1287
- var formkitVersion = '202609012101';
1287
+ var formkitVersion = '202609022200';
1288
1288
 
1289
1289
  // Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
1290
1290
  // See LICENSE in the project root for license information.
@@ -1237,7 +1237,7 @@ class AuroHelpText extends LitElement {
1237
1237
  }
1238
1238
  }
1239
1239
 
1240
- var formkitVersion = '202609012101';
1240
+ var formkitVersion = '202609022200';
1241
1241
 
1242
1242
  // Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
1243
1243
  // See LICENSE in the project root for license information.
@@ -1237,7 +1237,7 @@ class AuroHelpText extends LitElement {
1237
1237
  }
1238
1238
  }
1239
1239
 
1240
- var formkitVersion = '202609012101';
1240
+ var formkitVersion = '202609022200';
1241
1241
 
1242
1242
  // Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
1243
1243
  // See LICENSE in the project root for license information.
@@ -3003,6 +3003,48 @@ const computePosition = (reference, floating, options) => {
3003
3003
  });
3004
3004
  };
3005
3005
 
3006
+ /**
3007
+ * Generates a v4 UUID with a three-tier fallback for insecure contexts.
3008
+ *
3009
+ * Tier 1 (secure contexts): crypto.randomUUID() — native, fully random.
3010
+ * Tier 2 (insecure contexts): crypto.getRandomValues() — available on all
3011
+ * modern browsers regardless of secure-context status.
3012
+ * Tier 3 (last resort, no crypto API): new Date().getTime() — lower entropy,
3013
+ * but sufficient for element IDs where collision risk is negligible.
3014
+ *
3015
+ * See: https://w3c.github.io/webcrypto/#dom-crypto-randomuuid (secure-context restriction)
3016
+ */
3017
+ function generateUUID() {
3018
+ let uuid;
3019
+
3020
+ if (
3021
+ typeof crypto !== "undefined" &&
3022
+ typeof crypto.randomUUID === "function"
3023
+ ) {
3024
+ uuid = crypto.randomUUID();
3025
+ } else if (
3026
+ typeof crypto !== "undefined" &&
3027
+ typeof crypto.getRandomValues === "function"
3028
+ ) {
3029
+ const bytes = new Uint8Array(16);
3030
+ crypto.getRandomValues(bytes);
3031
+ bytes[6] = (bytes[6] & 0x0f) | 0x40;
3032
+ bytes[8] = (bytes[8] & 0x3f) | 0x80;
3033
+ const hex = Array.from(bytes).map((b) => b.toString(16).padStart(2, "0"));
3034
+ uuid = `${hex.slice(0, 4).join("")}-${hex.slice(4, 6).join("")}-${hex.slice(6, 8).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10).join("")}`;
3035
+ } else {
3036
+ let d = new Date().getTime();
3037
+ uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
3038
+ const r = (d % 16) | 0;
3039
+ d = (d - r) / 16 || new Date().getTime();
3040
+ return (c === "x" ? r : (r & 0x3) | 0x8).toString(16);
3041
+ });
3042
+ }
3043
+
3044
+ // CSS selectors require IDs starting with a letter; replace a leading digit with 'a'.
3045
+ return /^[0-9]/.test(uuid) ? `a${uuid.slice(1)}` : uuid;
3046
+ }
3047
+
3006
3048
  /* eslint-disable line-comment-position, no-inline-comments */
3007
3049
 
3008
3050
 
@@ -4021,7 +4063,7 @@ class AuroFloatingUI {
4021
4063
 
4022
4064
  this.id = element.getAttribute("id");
4023
4065
  if (!this.id) {
4024
- this.id = window.crypto.randomUUID();
4066
+ this.id = generateUUID();
4025
4067
  element.setAttribute("id", this.id);
4026
4068
  }
4027
4069
 
@@ -5066,7 +5108,7 @@ let AuroHelpText$2 = class AuroHelpText extends i$3 {
5066
5108
  }
5067
5109
  };
5068
5110
 
5069
- var formkitVersion$2 = '202609012101';
5111
+ var formkitVersion$2 = '202609022200';
5070
5112
 
5071
5113
  /**
5072
5114
  * AuroElement is the shared base class for layout-aware Auro form components.
@@ -18935,7 +18977,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$3 {
18935
18977
  }
18936
18978
  };
18937
18979
 
18938
- var formkitVersion$1 = '202609012101';
18980
+ var formkitVersion$1 = '202609022200';
18939
18981
 
18940
18982
  // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
18941
18983
  // See LICENSE in the project root for license information.
@@ -20127,7 +20169,7 @@ class AuroBibtemplate extends i$3 {
20127
20169
  }
20128
20170
  }
20129
20171
 
20130
- var formkitVersion = '202609012101';
20172
+ var formkitVersion = '202609022200';
20131
20173
 
20132
20174
  var styleCss$3 = i$6`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;text-align:left}:host [auro-dropdown]{--ds-auro-dropdown-trigger-background-color: transparent}:host #inputInBib::part(wrapper){box-shadow:none}:host #inputInBib::part(accent-left){display:none}:host([layout*=classic]) [auro-input]{width:100%}:host([layout*=classic]) [auro-input]::part(helpText){display:none}:host([layout*=classic]) #slotHolder{display:none}`;
20133
20175
 
@@ -20568,6 +20610,11 @@ class AuroCombobox extends AuroElement {
20568
20610
  this.behavior = "suggestion";
20569
20611
  this.clearBtnFocused = false;
20570
20612
 
20613
+ // One-shot: set when the input's clear button is activated so the
20614
+ // SPA-preselect guard in handleInputValueChange doesn't swallow the
20615
+ // genuine clear (AB#1634257).
20616
+ this._clearBtnActivated = false;
20617
+
20571
20618
  // Defaults that effect the overall layout of the combobox
20572
20619
  this.checkmark = false;
20573
20620
  this.dvInputOnly = false;
@@ -21525,6 +21572,13 @@ class AuroCombobox extends AuroElement {
21525
21572
  this.bibtemplate = this.dropdown.querySelector(this.bibtemplateTag._$litStatic$);
21526
21573
  this.inputInBib = this.bibtemplate.querySelector(this.inputTag._$litStatic$);
21527
21574
 
21575
+ // Mirror the trigger's clear-button tracking onto the fullscreen bib input
21576
+ // so clearing there also fully resets the combobox (AB#1634257). See
21577
+ // trackClearBtnActivation for why this must run in the capture phase.
21578
+ if (this.inputInBib && this.inputInBib !== this.input) {
21579
+ this.trackClearBtnActivation(this.inputInBib);
21580
+ }
21581
+
21528
21582
  // Pass label text to the dropdown bib for accessible dialog naming
21529
21583
  const labelElement = this.querySelector('[slot="label"]');
21530
21584
  if (labelElement) {
@@ -21910,6 +21964,52 @@ class AuroCombobox extends AuroElement {
21910
21964
  this.clearBtnFocused = false;
21911
21965
  }
21912
21966
  });
21967
+
21968
+ this.trackClearBtnActivation(this.input);
21969
+ }
21970
+
21971
+ /**
21972
+ * Flags genuine clear-button activations on an auro-input so the SPA-preselect
21973
+ * guard in handleInputValueChange doesn't swallow them.
21974
+ *
21975
+ * The auro-input clear button fires an `isProgrammatic` input event (via
21976
+ * notifyValueChanged) that is indistinguishable in shape from the
21977
+ * SPA-preselect echo that guard bails on (isProgrammatic + set value + empty
21978
+ * input). Without this one-shot flag, clicking clear would leave
21979
+ * this.value/optionSelected stale (AB#1634257).
21980
+ *
21981
+ * Delegated on the shadow root so it works regardless of when .clearBtn
21982
+ * renders (it only exists after a value is set), and covers both real clicks
21983
+ * and programmatic clearBtn.click() (which no focusin precedes). Registered in
21984
+ * the CAPTURE phase so the flag is set BEFORE the button's own @click
21985
+ * (handleClickClear) fires its synchronous input event — which is when
21986
+ * handleInputValueChange reads the flag.
21987
+ * @private
21988
+ * @param {Element} inputEl - The auro-input whose clear button to track.
21989
+ * @returns {void}
21990
+ */
21991
+ trackClearBtnActivation(inputEl) {
21992
+ if (!inputEl || !inputEl.shadowRoot) {
21993
+ return;
21994
+ }
21995
+ inputEl.shadowRoot.addEventListener('click', (event) => {
21996
+ if (event.target.closest('.clearBtn')) {
21997
+ this._clearBtnActivated = true;
21998
+
21999
+ // Bound the flag's lifetime to this synchronous clear -> input window.
22000
+ // auro-input's handleClickClear fires its input event synchronously
22001
+ // (before any macrotask runs), so handleInputValueChange consumes the
22002
+ // flag first and this reset is a harmless no-op. It only does real work
22003
+ // if that input event never arrives (e.g. auro-input throws mid-clear),
22004
+ // guaranteeing the flag can't survive to be misread as a genuine clear
22005
+ // by a later unrelated event such as an SPA-preselect echo (AB#1634257).
22006
+ // Scheduled via _scheduleTimer so disconnectedCallback cancels it if the
22007
+ // component tears down inside that window.
22008
+ this._scheduleTimer(() => {
22009
+ this._clearBtnActivated = false;
22010
+ }, 0);
22011
+ }
22012
+ }, true);
21913
22013
  }
21914
22014
 
21915
22015
  /**
@@ -21951,6 +22051,17 @@ class AuroCombobox extends AuroElement {
21951
22051
  * @returns {void}
21952
22052
  */
21953
22053
  handleInputValueChange(event) {
22054
+ // Consume the one-shot clear-button flag on EVERY entry, before any branch
22055
+ // below can early-return. trackClearBtnActivation sets it in the capture
22056
+ // phase right before auro-input's clear button fires its synchronous input
22057
+ // event; reading and immediately clearing it here guarantees the flag never
22058
+ // survives a handleInputValueChange call to leak into a later event (e.g.
22059
+ // the bib branch bailing at _syncingDisplayValue, or an SPA-preselect echo)
22060
+ // where it would defeat the guard below. Held in a local so that guard can
22061
+ // still tell a genuine clear from the init-render echo (AB#1634257).
22062
+ const clearBtnActivated = this._clearBtnActivated;
22063
+ this._clearBtnActivated = false;
22064
+
21954
22065
  // When the event comes from the fullscreen bib input, sync the value to
21955
22066
  // the trigger input. Setting trigger.value triggers Lit's updated()
21956
22067
  // (async, microtask) which fires notifyValueChanged() → another 'input'
@@ -21998,7 +22109,12 @@ class AuroCombobox extends AuroElement {
21998
22109
  // to the exact shape of that echo (isProgrammatic + non-empty combobox
21999
22110
  // value + empty input.value) so it doesn't affect the swap/typed paths
22000
22111
  // where value/input already track each other through the sync helpers.
22001
- if (event && event.isProgrammatic && this.value && !this.input.value) {
22112
+ // The clear button's echo has the same shape (isProgrammatic + set value +
22113
+ // empty input) but is a genuine user clear that MUST reset this.value and
22114
+ // optionSelected below. clearBtnActivated (consumed at the top of this
22115
+ // method) is true only for that genuine clear, so only the real
22116
+ // SPA-preselect echo bails (AB#1634257).
22117
+ if (event && event.isProgrammatic && this.value && !this.input.value && !clearBtnActivated) {
22002
22118
  return;
22003
22119
  }
22004
22120
 
@@ -22143,6 +22259,14 @@ class AuroCombobox extends AuroElement {
22143
22259
  // retry would otherwise keep rescheduling itself indefinitely.
22144
22260
  this._pendingTimers.forEach((id) => clearTimeout(id));
22145
22261
  this._pendingTimers.clear();
22262
+
22263
+ // Cancelling the timers above drops the macrotask that would have reset
22264
+ // _clearBtnActivated, so reset it here too. Otherwise a disconnect inside
22265
+ // the clear-click -> macrotask window strands the flag `true`; instance
22266
+ // state survives reconnect, and the first matching input event (including
22267
+ // an SPA-preselect echo) would then bypass the guard in
22268
+ // handleInputValueChange and silently clear value/optionSelected (AB#1634257).
22269
+ this._clearBtnActivated = false;
22146
22270
  }
22147
22271
 
22148
22272
  firstUpdated() {
@@ -22241,6 +22365,14 @@ class AuroCombobox extends AuroElement {
22241
22365
  }
22242
22366
  if (this.menu.value || this.menu.optionSelected) {
22243
22367
  this.menu.reset();
22368
+ } else {
22369
+ // The menu's selection properties are already cleared, but option
22370
+ // elements can still carry a stale `selected` attribute (e.g. the menu
22371
+ // options were rebuilt after the value was set, orphaning the DOM from
22372
+ // the now-null optionSelected). reset() is skipped above in that case,
22373
+ // so re-sync the option DOM directly to guarantee no option renders as
22374
+ // selected once the field is cleared (AB#1634259).
22375
+ this.menu.clearSelection();
22244
22376
  }
22245
22377
  } finally {
22246
22378
  this._clearing = false;
@@ -23692,6 +23824,22 @@ class AuroMenu extends AuroElement {
23692
23824
  this.value = undefined;
23693
23825
  this._selectedKey = undefined;
23694
23826
  this._index = -1;
23827
+
23828
+ // Eagerly sync the option DOM to the now-empty selection. Nulling the
23829
+ // reactive properties above normally schedules updated() → updateItemsState,
23830
+ // but that only runs when a property actually changes. If an option still
23831
+ // carries a stale `selected`/`aria-selected` attribute while these
23832
+ // properties are already undefined (e.g. options were rebuilt after a value
23833
+ // was set), no re-render fires and the option keeps rendering as selected.
23834
+ // Strip that state now so no option looks selected after a clear (AB#1634259).
23835
+ // Intentionally leaves `active`/`optionActive` untouched so a highlighted
23836
+ // option remains keyboard-re-selectable after emptying the value (AB#1606433).
23837
+ this.updateItemsState(new Map([
23838
+ [
23839
+ 'optionSelected',
23840
+ true
23841
+ ]
23842
+ ]));
23695
23843
  }
23696
23844
 
23697
23845
  /**
@@ -3003,6 +3003,48 @@ const computePosition = (reference, floating, options) => {
3003
3003
  });
3004
3004
  };
3005
3005
 
3006
+ /**
3007
+ * Generates a v4 UUID with a three-tier fallback for insecure contexts.
3008
+ *
3009
+ * Tier 1 (secure contexts): crypto.randomUUID() — native, fully random.
3010
+ * Tier 2 (insecure contexts): crypto.getRandomValues() — available on all
3011
+ * modern browsers regardless of secure-context status.
3012
+ * Tier 3 (last resort, no crypto API): new Date().getTime() — lower entropy,
3013
+ * but sufficient for element IDs where collision risk is negligible.
3014
+ *
3015
+ * See: https://w3c.github.io/webcrypto/#dom-crypto-randomuuid (secure-context restriction)
3016
+ */
3017
+ function generateUUID() {
3018
+ let uuid;
3019
+
3020
+ if (
3021
+ typeof crypto !== "undefined" &&
3022
+ typeof crypto.randomUUID === "function"
3023
+ ) {
3024
+ uuid = crypto.randomUUID();
3025
+ } else if (
3026
+ typeof crypto !== "undefined" &&
3027
+ typeof crypto.getRandomValues === "function"
3028
+ ) {
3029
+ const bytes = new Uint8Array(16);
3030
+ crypto.getRandomValues(bytes);
3031
+ bytes[6] = (bytes[6] & 0x0f) | 0x40;
3032
+ bytes[8] = (bytes[8] & 0x3f) | 0x80;
3033
+ const hex = Array.from(bytes).map((b) => b.toString(16).padStart(2, "0"));
3034
+ uuid = `${hex.slice(0, 4).join("")}-${hex.slice(4, 6).join("")}-${hex.slice(6, 8).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10).join("")}`;
3035
+ } else {
3036
+ let d = new Date().getTime();
3037
+ uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
3038
+ const r = (d % 16) | 0;
3039
+ d = (d - r) / 16 || new Date().getTime();
3040
+ return (c === "x" ? r : (r & 0x3) | 0x8).toString(16);
3041
+ });
3042
+ }
3043
+
3044
+ // CSS selectors require IDs starting with a letter; replace a leading digit with 'a'.
3045
+ return /^[0-9]/.test(uuid) ? `a${uuid.slice(1)}` : uuid;
3046
+ }
3047
+
3006
3048
  /* eslint-disable line-comment-position, no-inline-comments */
3007
3049
 
3008
3050
 
@@ -4021,7 +4063,7 @@ class AuroFloatingUI {
4021
4063
 
4022
4064
  this.id = element.getAttribute("id");
4023
4065
  if (!this.id) {
4024
- this.id = window.crypto.randomUUID();
4066
+ this.id = generateUUID();
4025
4067
  element.setAttribute("id", this.id);
4026
4068
  }
4027
4069
 
@@ -5066,7 +5108,7 @@ let AuroHelpText$2 = class AuroHelpText extends i$3 {
5066
5108
  }
5067
5109
  };
5068
5110
 
5069
- var formkitVersion$2 = '202609012101';
5111
+ var formkitVersion$2 = '202609022200';
5070
5112
 
5071
5113
  /**
5072
5114
  * AuroElement is the shared base class for layout-aware Auro form components.
@@ -18935,7 +18977,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$3 {
18935
18977
  }
18936
18978
  };
18937
18979
 
18938
- var formkitVersion$1 = '202609012101';
18980
+ var formkitVersion$1 = '202609022200';
18939
18981
 
18940
18982
  // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
18941
18983
  // See LICENSE in the project root for license information.
@@ -20127,7 +20169,7 @@ class AuroBibtemplate extends i$3 {
20127
20169
  }
20128
20170
  }
20129
20171
 
20130
- var formkitVersion = '202609012101';
20172
+ var formkitVersion = '202609022200';
20131
20173
 
20132
20174
  var styleCss$3 = i$6`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;text-align:left}:host [auro-dropdown]{--ds-auro-dropdown-trigger-background-color: transparent}:host #inputInBib::part(wrapper){box-shadow:none}:host #inputInBib::part(accent-left){display:none}:host([layout*=classic]) [auro-input]{width:100%}:host([layout*=classic]) [auro-input]::part(helpText){display:none}:host([layout*=classic]) #slotHolder{display:none}`;
20133
20175
 
@@ -20568,6 +20610,11 @@ class AuroCombobox extends AuroElement {
20568
20610
  this.behavior = "suggestion";
20569
20611
  this.clearBtnFocused = false;
20570
20612
 
20613
+ // One-shot: set when the input's clear button is activated so the
20614
+ // SPA-preselect guard in handleInputValueChange doesn't swallow the
20615
+ // genuine clear (AB#1634257).
20616
+ this._clearBtnActivated = false;
20617
+
20571
20618
  // Defaults that effect the overall layout of the combobox
20572
20619
  this.checkmark = false;
20573
20620
  this.dvInputOnly = false;
@@ -21525,6 +21572,13 @@ class AuroCombobox extends AuroElement {
21525
21572
  this.bibtemplate = this.dropdown.querySelector(this.bibtemplateTag._$litStatic$);
21526
21573
  this.inputInBib = this.bibtemplate.querySelector(this.inputTag._$litStatic$);
21527
21574
 
21575
+ // Mirror the trigger's clear-button tracking onto the fullscreen bib input
21576
+ // so clearing there also fully resets the combobox (AB#1634257). See
21577
+ // trackClearBtnActivation for why this must run in the capture phase.
21578
+ if (this.inputInBib && this.inputInBib !== this.input) {
21579
+ this.trackClearBtnActivation(this.inputInBib);
21580
+ }
21581
+
21528
21582
  // Pass label text to the dropdown bib for accessible dialog naming
21529
21583
  const labelElement = this.querySelector('[slot="label"]');
21530
21584
  if (labelElement) {
@@ -21910,6 +21964,52 @@ class AuroCombobox extends AuroElement {
21910
21964
  this.clearBtnFocused = false;
21911
21965
  }
21912
21966
  });
21967
+
21968
+ this.trackClearBtnActivation(this.input);
21969
+ }
21970
+
21971
+ /**
21972
+ * Flags genuine clear-button activations on an auro-input so the SPA-preselect
21973
+ * guard in handleInputValueChange doesn't swallow them.
21974
+ *
21975
+ * The auro-input clear button fires an `isProgrammatic` input event (via
21976
+ * notifyValueChanged) that is indistinguishable in shape from the
21977
+ * SPA-preselect echo that guard bails on (isProgrammatic + set value + empty
21978
+ * input). Without this one-shot flag, clicking clear would leave
21979
+ * this.value/optionSelected stale (AB#1634257).
21980
+ *
21981
+ * Delegated on the shadow root so it works regardless of when .clearBtn
21982
+ * renders (it only exists after a value is set), and covers both real clicks
21983
+ * and programmatic clearBtn.click() (which no focusin precedes). Registered in
21984
+ * the CAPTURE phase so the flag is set BEFORE the button's own @click
21985
+ * (handleClickClear) fires its synchronous input event — which is when
21986
+ * handleInputValueChange reads the flag.
21987
+ * @private
21988
+ * @param {Element} inputEl - The auro-input whose clear button to track.
21989
+ * @returns {void}
21990
+ */
21991
+ trackClearBtnActivation(inputEl) {
21992
+ if (!inputEl || !inputEl.shadowRoot) {
21993
+ return;
21994
+ }
21995
+ inputEl.shadowRoot.addEventListener('click', (event) => {
21996
+ if (event.target.closest('.clearBtn')) {
21997
+ this._clearBtnActivated = true;
21998
+
21999
+ // Bound the flag's lifetime to this synchronous clear -> input window.
22000
+ // auro-input's handleClickClear fires its input event synchronously
22001
+ // (before any macrotask runs), so handleInputValueChange consumes the
22002
+ // flag first and this reset is a harmless no-op. It only does real work
22003
+ // if that input event never arrives (e.g. auro-input throws mid-clear),
22004
+ // guaranteeing the flag can't survive to be misread as a genuine clear
22005
+ // by a later unrelated event such as an SPA-preselect echo (AB#1634257).
22006
+ // Scheduled via _scheduleTimer so disconnectedCallback cancels it if the
22007
+ // component tears down inside that window.
22008
+ this._scheduleTimer(() => {
22009
+ this._clearBtnActivated = false;
22010
+ }, 0);
22011
+ }
22012
+ }, true);
21913
22013
  }
21914
22014
 
21915
22015
  /**
@@ -21951,6 +22051,17 @@ class AuroCombobox extends AuroElement {
21951
22051
  * @returns {void}
21952
22052
  */
21953
22053
  handleInputValueChange(event) {
22054
+ // Consume the one-shot clear-button flag on EVERY entry, before any branch
22055
+ // below can early-return. trackClearBtnActivation sets it in the capture
22056
+ // phase right before auro-input's clear button fires its synchronous input
22057
+ // event; reading and immediately clearing it here guarantees the flag never
22058
+ // survives a handleInputValueChange call to leak into a later event (e.g.
22059
+ // the bib branch bailing at _syncingDisplayValue, or an SPA-preselect echo)
22060
+ // where it would defeat the guard below. Held in a local so that guard can
22061
+ // still tell a genuine clear from the init-render echo (AB#1634257).
22062
+ const clearBtnActivated = this._clearBtnActivated;
22063
+ this._clearBtnActivated = false;
22064
+
21954
22065
  // When the event comes from the fullscreen bib input, sync the value to
21955
22066
  // the trigger input. Setting trigger.value triggers Lit's updated()
21956
22067
  // (async, microtask) which fires notifyValueChanged() → another 'input'
@@ -21998,7 +22109,12 @@ class AuroCombobox extends AuroElement {
21998
22109
  // to the exact shape of that echo (isProgrammatic + non-empty combobox
21999
22110
  // value + empty input.value) so it doesn't affect the swap/typed paths
22000
22111
  // where value/input already track each other through the sync helpers.
22001
- if (event && event.isProgrammatic && this.value && !this.input.value) {
22112
+ // The clear button's echo has the same shape (isProgrammatic + set value +
22113
+ // empty input) but is a genuine user clear that MUST reset this.value and
22114
+ // optionSelected below. clearBtnActivated (consumed at the top of this
22115
+ // method) is true only for that genuine clear, so only the real
22116
+ // SPA-preselect echo bails (AB#1634257).
22117
+ if (event && event.isProgrammatic && this.value && !this.input.value && !clearBtnActivated) {
22002
22118
  return;
22003
22119
  }
22004
22120
 
@@ -22143,6 +22259,14 @@ class AuroCombobox extends AuroElement {
22143
22259
  // retry would otherwise keep rescheduling itself indefinitely.
22144
22260
  this._pendingTimers.forEach((id) => clearTimeout(id));
22145
22261
  this._pendingTimers.clear();
22262
+
22263
+ // Cancelling the timers above drops the macrotask that would have reset
22264
+ // _clearBtnActivated, so reset it here too. Otherwise a disconnect inside
22265
+ // the clear-click -> macrotask window strands the flag `true`; instance
22266
+ // state survives reconnect, and the first matching input event (including
22267
+ // an SPA-preselect echo) would then bypass the guard in
22268
+ // handleInputValueChange and silently clear value/optionSelected (AB#1634257).
22269
+ this._clearBtnActivated = false;
22146
22270
  }
22147
22271
 
22148
22272
  firstUpdated() {
@@ -22241,6 +22365,14 @@ class AuroCombobox extends AuroElement {
22241
22365
  }
22242
22366
  if (this.menu.value || this.menu.optionSelected) {
22243
22367
  this.menu.reset();
22368
+ } else {
22369
+ // The menu's selection properties are already cleared, but option
22370
+ // elements can still carry a stale `selected` attribute (e.g. the menu
22371
+ // options were rebuilt after the value was set, orphaning the DOM from
22372
+ // the now-null optionSelected). reset() is skipped above in that case,
22373
+ // so re-sync the option DOM directly to guarantee no option renders as
22374
+ // selected once the field is cleared (AB#1634259).
22375
+ this.menu.clearSelection();
22244
22376
  }
22245
22377
  } finally {
22246
22378
  this._clearing = false;
@@ -23692,6 +23824,22 @@ class AuroMenu extends AuroElement {
23692
23824
  this.value = undefined;
23693
23825
  this._selectedKey = undefined;
23694
23826
  this._index = -1;
23827
+
23828
+ // Eagerly sync the option DOM to the now-empty selection. Nulling the
23829
+ // reactive properties above normally schedules updated() → updateItemsState,
23830
+ // but that only runs when a property actually changes. If an option still
23831
+ // carries a stale `selected`/`aria-selected` attribute while these
23832
+ // properties are already undefined (e.g. options were rebuilt after a value
23833
+ // was set), no re-render fires and the option keeps rendering as selected.
23834
+ // Strip that state now so no option looks selected after a clear (AB#1634259).
23835
+ // Intentionally leaves `active`/`optionActive` untouched so a highlighted
23836
+ // option remains keyboard-re-selectable after emptying the value (AB#1606433).
23837
+ this.updateItemsState(new Map([
23838
+ [
23839
+ 'optionSelected',
23840
+ true
23841
+ ]
23842
+ ]));
23695
23843
  }
23696
23844
 
23697
23845
  /**