@aurodesignsystem-dev/auro-formkit 0.0.0-pr783.0 → 0.0.0-pr783.1

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.
@@ -2814,7 +2814,7 @@ class AuroFloatingUI {
2814
2814
  */
2815
2815
  mirrorSize() {
2816
2816
  // mirror the boxsize from bibSizer
2817
- if (this.element.bibSizer) {
2817
+ if (this.element.bibSizer && this.element.matchWidth) {
2818
2818
  const sizerStyle = window.getComputedStyle(this.element.bibSizer);
2819
2819
  const bibContent = this.element.bib.shadowRoot.querySelector(".container");
2820
2820
  if (sizerStyle.width !== '0px') {
@@ -3026,13 +3026,13 @@ class AuroFloatingUI {
3026
3026
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
3027
3027
  return;
3028
3028
  }
3029
-
3029
+
3030
3030
  // if fullscreen bib is in fullscreen mode, do not close
3031
3031
  if (this.element.bib.hasAttribute('isfullscreen')) {
3032
3032
  return;
3033
3033
  }
3034
3034
 
3035
- this.hideBib();
3035
+ this.hideBib("keydown");
3036
3036
  }
3037
3037
 
3038
3038
  setupHideHandlers() {
@@ -3057,7 +3057,7 @@ class AuroFloatingUI {
3057
3057
  document.expandedAuroFormkitDropdown = null;
3058
3058
  document.expandedAuroFloater = this;
3059
3059
  } else {
3060
- this.hideBib();
3060
+ this.hideBib("click");
3061
3061
  }
3062
3062
  }
3063
3063
  };
@@ -3070,7 +3070,7 @@ class AuroFloatingUI {
3070
3070
  // if something else is open, let it handle itself
3071
3071
  return;
3072
3072
  }
3073
- this.hideBib();
3073
+ this.hideBib("keydown");
3074
3074
  }
3075
3075
  };
3076
3076
 
@@ -3153,7 +3153,11 @@ class AuroFloatingUI {
3153
3153
  }
3154
3154
  }
3155
3155
 
3156
- hideBib() {
3156
+ /**
3157
+ * Hides the floating UI element.
3158
+ * @param {String} eventType - The event type that triggered the hiding action.
3159
+ */
3160
+ hideBib(eventType = "unknown") {
3157
3161
  if (!this.element.disabled && !this.element.noToggle) {
3158
3162
  this.lockScroll(false);
3159
3163
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -3164,7 +3168,7 @@ class AuroFloatingUI {
3164
3168
  if (this.showing) {
3165
3169
  this.cleanupHideHandlers();
3166
3170
  this.showing = false;
3167
- this.dispatchEventDropdownToggle();
3171
+ this.dispatchEventDropdownToggle(eventType);
3168
3172
  }
3169
3173
  }
3170
3174
  document.expandedAuroFloater = null;
@@ -3173,11 +3177,13 @@ class AuroFloatingUI {
3173
3177
  /**
3174
3178
  * @private
3175
3179
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
3180
+ * @param {String} eventType - The event type that triggered the toggle action.
3176
3181
  */
3177
- dispatchEventDropdownToggle() {
3182
+ dispatchEventDropdownToggle(eventType) {
3178
3183
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
3179
3184
  detail: {
3180
3185
  expanded: this.showing,
3186
+ eventType: eventType || "unknown",
3181
3187
  },
3182
3188
  composed: true
3183
3189
  });
@@ -3187,7 +3193,7 @@ class AuroFloatingUI {
3187
3193
 
3188
3194
  handleClick() {
3189
3195
  if (this.element.isPopoverVisible) {
3190
- this.hideBib();
3196
+ this.hideBib("click");
3191
3197
  } else {
3192
3198
  this.showBib();
3193
3199
  }
@@ -3214,7 +3220,7 @@ class AuroFloatingUI {
3214
3220
 
3215
3221
  event.preventDefault();
3216
3222
  this.handleClick();
3217
- }
3223
+ }
3218
3224
  break;
3219
3225
  case 'mouseenter':
3220
3226
  if (this.element.hoverToggle) {
@@ -3223,7 +3229,7 @@ class AuroFloatingUI {
3223
3229
  break;
3224
3230
  case 'mouseleave':
3225
3231
  if (this.element.hoverToggle) {
3226
- this.hideBib();
3232
+ this.hideBib("mouseleave");
3227
3233
  }
3228
3234
  break;
3229
3235
  case 'focus':
@@ -4611,6 +4617,9 @@ class AuroDropdown extends AuroElement$3 {
4611
4617
 
4612
4618
  this.parentBorder = false;
4613
4619
 
4620
+ /** @private */
4621
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
4622
+
4614
4623
  this.privateDefaults();
4615
4624
  }
4616
4625
 
@@ -5044,12 +5053,19 @@ class AuroDropdown extends AuroElement$3 {
5044
5053
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
5045
5054
  this.handleTriggerContentSlotChange();
5046
5055
  }
5056
+ }
5047
5057
 
5048
- if (changedProperties.has('isPopoverVisible')) {
5049
- this.updateFocusTrap();
5050
- if (!this.isPopoverVisible && this.hasFocus) {
5051
- this.trigger.focus();
5052
- }
5058
+ /**
5059
+ * Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
5060
+ * @private
5061
+ * @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
5062
+ */
5063
+ handleDropdownToggle(event) {
5064
+ this.updateFocusTrap();
5065
+ this.isPopoverVisible = event.detail.expanded;
5066
+ const eventType = event.detail.eventType || "unknown";
5067
+ if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
5068
+ this.trigger.focus();
5053
5069
  }
5054
5070
  }
5055
5071
 
@@ -5057,6 +5073,7 @@ class AuroDropdown extends AuroElement$3 {
5057
5073
 
5058
5074
  // Configure the floater to, this will generate the ID for the bib
5059
5075
  this.floater.configure(this, 'auroDropdown');
5076
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
5060
5077
 
5061
5078
  /**
5062
5079
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -2722,7 +2722,7 @@ class AuroFloatingUI {
2722
2722
  */
2723
2723
  mirrorSize() {
2724
2724
  // mirror the boxsize from bibSizer
2725
- if (this.element.bibSizer) {
2725
+ if (this.element.bibSizer && this.element.matchWidth) {
2726
2726
  const sizerStyle = window.getComputedStyle(this.element.bibSizer);
2727
2727
  const bibContent = this.element.bib.shadowRoot.querySelector(".container");
2728
2728
  if (sizerStyle.width !== '0px') {
@@ -2934,13 +2934,13 @@ class AuroFloatingUI {
2934
2934
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
2935
2935
  return;
2936
2936
  }
2937
-
2937
+
2938
2938
  // if fullscreen bib is in fullscreen mode, do not close
2939
2939
  if (this.element.bib.hasAttribute('isfullscreen')) {
2940
2940
  return;
2941
2941
  }
2942
2942
 
2943
- this.hideBib();
2943
+ this.hideBib("keydown");
2944
2944
  }
2945
2945
 
2946
2946
  setupHideHandlers() {
@@ -2965,7 +2965,7 @@ class AuroFloatingUI {
2965
2965
  document.expandedAuroFormkitDropdown = null;
2966
2966
  document.expandedAuroFloater = this;
2967
2967
  } else {
2968
- this.hideBib();
2968
+ this.hideBib("click");
2969
2969
  }
2970
2970
  }
2971
2971
  };
@@ -2978,7 +2978,7 @@ class AuroFloatingUI {
2978
2978
  // if something else is open, let it handle itself
2979
2979
  return;
2980
2980
  }
2981
- this.hideBib();
2981
+ this.hideBib("keydown");
2982
2982
  }
2983
2983
  };
2984
2984
 
@@ -3061,7 +3061,11 @@ class AuroFloatingUI {
3061
3061
  }
3062
3062
  }
3063
3063
 
3064
- hideBib() {
3064
+ /**
3065
+ * Hides the floating UI element.
3066
+ * @param {String} eventType - The event type that triggered the hiding action.
3067
+ */
3068
+ hideBib(eventType = "unknown") {
3065
3069
  if (!this.element.disabled && !this.element.noToggle) {
3066
3070
  this.lockScroll(false);
3067
3071
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -3072,7 +3076,7 @@ class AuroFloatingUI {
3072
3076
  if (this.showing) {
3073
3077
  this.cleanupHideHandlers();
3074
3078
  this.showing = false;
3075
- this.dispatchEventDropdownToggle();
3079
+ this.dispatchEventDropdownToggle(eventType);
3076
3080
  }
3077
3081
  }
3078
3082
  document.expandedAuroFloater = null;
@@ -3081,11 +3085,13 @@ class AuroFloatingUI {
3081
3085
  /**
3082
3086
  * @private
3083
3087
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
3088
+ * @param {String} eventType - The event type that triggered the toggle action.
3084
3089
  */
3085
- dispatchEventDropdownToggle() {
3090
+ dispatchEventDropdownToggle(eventType) {
3086
3091
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
3087
3092
  detail: {
3088
3093
  expanded: this.showing,
3094
+ eventType: eventType || "unknown",
3089
3095
  },
3090
3096
  composed: true
3091
3097
  });
@@ -3095,7 +3101,7 @@ class AuroFloatingUI {
3095
3101
 
3096
3102
  handleClick() {
3097
3103
  if (this.element.isPopoverVisible) {
3098
- this.hideBib();
3104
+ this.hideBib("click");
3099
3105
  } else {
3100
3106
  this.showBib();
3101
3107
  }
@@ -3122,7 +3128,7 @@ class AuroFloatingUI {
3122
3128
 
3123
3129
  event.preventDefault();
3124
3130
  this.handleClick();
3125
- }
3131
+ }
3126
3132
  break;
3127
3133
  case 'mouseenter':
3128
3134
  if (this.element.hoverToggle) {
@@ -3131,7 +3137,7 @@ class AuroFloatingUI {
3131
3137
  break;
3132
3138
  case 'mouseleave':
3133
3139
  if (this.element.hoverToggle) {
3134
- this.hideBib();
3140
+ this.hideBib("mouseleave");
3135
3141
  }
3136
3142
  break;
3137
3143
  case 'focus':
@@ -4519,6 +4525,9 @@ class AuroDropdown extends AuroElement$3 {
4519
4525
 
4520
4526
  this.parentBorder = false;
4521
4527
 
4528
+ /** @private */
4529
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
4530
+
4522
4531
  this.privateDefaults();
4523
4532
  }
4524
4533
 
@@ -4952,12 +4961,19 @@ class AuroDropdown extends AuroElement$3 {
4952
4961
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
4953
4962
  this.handleTriggerContentSlotChange();
4954
4963
  }
4964
+ }
4955
4965
 
4956
- if (changedProperties.has('isPopoverVisible')) {
4957
- this.updateFocusTrap();
4958
- if (!this.isPopoverVisible && this.hasFocus) {
4959
- this.trigger.focus();
4960
- }
4966
+ /**
4967
+ * Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
4968
+ * @private
4969
+ * @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
4970
+ */
4971
+ handleDropdownToggle(event) {
4972
+ this.updateFocusTrap();
4973
+ this.isPopoverVisible = event.detail.expanded;
4974
+ const eventType = event.detail.eventType || "unknown";
4975
+ if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
4976
+ this.trigger.focus();
4961
4977
  }
4962
4978
  }
4963
4979
 
@@ -4965,6 +4981,7 @@ class AuroDropdown extends AuroElement$3 {
4965
4981
 
4966
4982
  // Configure the floater to, this will generate the ID for the bib
4967
4983
  this.floater.configure(this, 'auroDropdown');
4984
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
4968
4985
 
4969
4986
  /**
4970
4987
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -2676,7 +2676,7 @@ class AuroFloatingUI {
2676
2676
  */
2677
2677
  mirrorSize() {
2678
2678
  // mirror the boxsize from bibSizer
2679
- if (this.element.bibSizer) {
2679
+ if (this.element.bibSizer && this.element.matchWidth) {
2680
2680
  const sizerStyle = window.getComputedStyle(this.element.bibSizer);
2681
2681
  const bibContent = this.element.bib.shadowRoot.querySelector(".container");
2682
2682
  if (sizerStyle.width !== '0px') {
@@ -2888,13 +2888,13 @@ class AuroFloatingUI {
2888
2888
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
2889
2889
  return;
2890
2890
  }
2891
-
2891
+
2892
2892
  // if fullscreen bib is in fullscreen mode, do not close
2893
2893
  if (this.element.bib.hasAttribute('isfullscreen')) {
2894
2894
  return;
2895
2895
  }
2896
2896
 
2897
- this.hideBib();
2897
+ this.hideBib("keydown");
2898
2898
  }
2899
2899
 
2900
2900
  setupHideHandlers() {
@@ -2919,7 +2919,7 @@ class AuroFloatingUI {
2919
2919
  document.expandedAuroFormkitDropdown = null;
2920
2920
  document.expandedAuroFloater = this;
2921
2921
  } else {
2922
- this.hideBib();
2922
+ this.hideBib("click");
2923
2923
  }
2924
2924
  }
2925
2925
  };
@@ -2932,7 +2932,7 @@ class AuroFloatingUI {
2932
2932
  // if something else is open, let it handle itself
2933
2933
  return;
2934
2934
  }
2935
- this.hideBib();
2935
+ this.hideBib("keydown");
2936
2936
  }
2937
2937
  };
2938
2938
 
@@ -3015,7 +3015,11 @@ class AuroFloatingUI {
3015
3015
  }
3016
3016
  }
3017
3017
 
3018
- hideBib() {
3018
+ /**
3019
+ * Hides the floating UI element.
3020
+ * @param {String} eventType - The event type that triggered the hiding action.
3021
+ */
3022
+ hideBib(eventType = "unknown") {
3019
3023
  if (!this.element.disabled && !this.element.noToggle) {
3020
3024
  this.lockScroll(false);
3021
3025
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -3026,7 +3030,7 @@ class AuroFloatingUI {
3026
3030
  if (this.showing) {
3027
3031
  this.cleanupHideHandlers();
3028
3032
  this.showing = false;
3029
- this.dispatchEventDropdownToggle();
3033
+ this.dispatchEventDropdownToggle(eventType);
3030
3034
  }
3031
3035
  }
3032
3036
  document.expandedAuroFloater = null;
@@ -3035,11 +3039,13 @@ class AuroFloatingUI {
3035
3039
  /**
3036
3040
  * @private
3037
3041
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
3042
+ * @param {String} eventType - The event type that triggered the toggle action.
3038
3043
  */
3039
- dispatchEventDropdownToggle() {
3044
+ dispatchEventDropdownToggle(eventType) {
3040
3045
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
3041
3046
  detail: {
3042
3047
  expanded: this.showing,
3048
+ eventType: eventType || "unknown",
3043
3049
  },
3044
3050
  composed: true
3045
3051
  });
@@ -3049,7 +3055,7 @@ class AuroFloatingUI {
3049
3055
 
3050
3056
  handleClick() {
3051
3057
  if (this.element.isPopoverVisible) {
3052
- this.hideBib();
3058
+ this.hideBib("click");
3053
3059
  } else {
3054
3060
  this.showBib();
3055
3061
  }
@@ -3076,7 +3082,7 @@ class AuroFloatingUI {
3076
3082
 
3077
3083
  event.preventDefault();
3078
3084
  this.handleClick();
3079
- }
3085
+ }
3080
3086
  break;
3081
3087
  case 'mouseenter':
3082
3088
  if (this.element.hoverToggle) {
@@ -3085,7 +3091,7 @@ class AuroFloatingUI {
3085
3091
  break;
3086
3092
  case 'mouseleave':
3087
3093
  if (this.element.hoverToggle) {
3088
- this.hideBib();
3094
+ this.hideBib("mouseleave");
3089
3095
  }
3090
3096
  break;
3091
3097
  case 'focus':
@@ -4473,6 +4479,9 @@ class AuroDropdown extends AuroElement$2 {
4473
4479
 
4474
4480
  this.parentBorder = false;
4475
4481
 
4482
+ /** @private */
4483
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
4484
+
4476
4485
  this.privateDefaults();
4477
4486
  }
4478
4487
 
@@ -4906,12 +4915,19 @@ class AuroDropdown extends AuroElement$2 {
4906
4915
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
4907
4916
  this.handleTriggerContentSlotChange();
4908
4917
  }
4918
+ }
4909
4919
 
4910
- if (changedProperties.has('isPopoverVisible')) {
4911
- this.updateFocusTrap();
4912
- if (!this.isPopoverVisible && this.hasFocus) {
4913
- this.trigger.focus();
4914
- }
4920
+ /**
4921
+ * Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
4922
+ * @private
4923
+ * @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
4924
+ */
4925
+ handleDropdownToggle(event) {
4926
+ this.updateFocusTrap();
4927
+ this.isPopoverVisible = event.detail.expanded;
4928
+ const eventType = event.detail.eventType || "unknown";
4929
+ if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
4930
+ this.trigger.focus();
4915
4931
  }
4916
4932
  }
4917
4933
 
@@ -4919,6 +4935,7 @@ class AuroDropdown extends AuroElement$2 {
4919
4935
 
4920
4936
  // Configure the floater to, this will generate the ID for the bib
4921
4937
  this.floater.configure(this, 'auroDropdown');
4938
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
4922
4939
 
4923
4940
  /**
4924
4941
  * @description Let subscribers know that the dropdown ID ha been generated and added.
@@ -2676,7 +2676,7 @@ class AuroFloatingUI {
2676
2676
  */
2677
2677
  mirrorSize() {
2678
2678
  // mirror the boxsize from bibSizer
2679
- if (this.element.bibSizer) {
2679
+ if (this.element.bibSizer && this.element.matchWidth) {
2680
2680
  const sizerStyle = window.getComputedStyle(this.element.bibSizer);
2681
2681
  const bibContent = this.element.bib.shadowRoot.querySelector(".container");
2682
2682
  if (sizerStyle.width !== '0px') {
@@ -2888,13 +2888,13 @@ class AuroFloatingUI {
2888
2888
  if (this.element.contains(activeElement) || this.element.bib?.contains(activeElement)) {
2889
2889
  return;
2890
2890
  }
2891
-
2891
+
2892
2892
  // if fullscreen bib is in fullscreen mode, do not close
2893
2893
  if (this.element.bib.hasAttribute('isfullscreen')) {
2894
2894
  return;
2895
2895
  }
2896
2896
 
2897
- this.hideBib();
2897
+ this.hideBib("keydown");
2898
2898
  }
2899
2899
 
2900
2900
  setupHideHandlers() {
@@ -2919,7 +2919,7 @@ class AuroFloatingUI {
2919
2919
  document.expandedAuroFormkitDropdown = null;
2920
2920
  document.expandedAuroFloater = this;
2921
2921
  } else {
2922
- this.hideBib();
2922
+ this.hideBib("click");
2923
2923
  }
2924
2924
  }
2925
2925
  };
@@ -2932,7 +2932,7 @@ class AuroFloatingUI {
2932
2932
  // if something else is open, let it handle itself
2933
2933
  return;
2934
2934
  }
2935
- this.hideBib();
2935
+ this.hideBib("keydown");
2936
2936
  }
2937
2937
  };
2938
2938
 
@@ -3015,7 +3015,11 @@ class AuroFloatingUI {
3015
3015
  }
3016
3016
  }
3017
3017
 
3018
- hideBib() {
3018
+ /**
3019
+ * Hides the floating UI element.
3020
+ * @param {String} eventType - The event type that triggered the hiding action.
3021
+ */
3022
+ hideBib(eventType = "unknown") {
3019
3023
  if (!this.element.disabled && !this.element.noToggle) {
3020
3024
  this.lockScroll(false);
3021
3025
  this.element.triggerChevron?.removeAttribute('data-expanded');
@@ -3026,7 +3030,7 @@ class AuroFloatingUI {
3026
3030
  if (this.showing) {
3027
3031
  this.cleanupHideHandlers();
3028
3032
  this.showing = false;
3029
- this.dispatchEventDropdownToggle();
3033
+ this.dispatchEventDropdownToggle(eventType);
3030
3034
  }
3031
3035
  }
3032
3036
  document.expandedAuroFloater = null;
@@ -3035,11 +3039,13 @@ class AuroFloatingUI {
3035
3039
  /**
3036
3040
  * @private
3037
3041
  * @returns {void} Dispatches event with an object showing the state of the dropdown.
3042
+ * @param {String} eventType - The event type that triggered the toggle action.
3038
3043
  */
3039
- dispatchEventDropdownToggle() {
3044
+ dispatchEventDropdownToggle(eventType) {
3040
3045
  const event = new CustomEvent(this.eventPrefix ? `${this.eventPrefix}-toggled` : 'toggled', {
3041
3046
  detail: {
3042
3047
  expanded: this.showing,
3048
+ eventType: eventType || "unknown",
3043
3049
  },
3044
3050
  composed: true
3045
3051
  });
@@ -3049,7 +3055,7 @@ class AuroFloatingUI {
3049
3055
 
3050
3056
  handleClick() {
3051
3057
  if (this.element.isPopoverVisible) {
3052
- this.hideBib();
3058
+ this.hideBib("click");
3053
3059
  } else {
3054
3060
  this.showBib();
3055
3061
  }
@@ -3076,7 +3082,7 @@ class AuroFloatingUI {
3076
3082
 
3077
3083
  event.preventDefault();
3078
3084
  this.handleClick();
3079
- }
3085
+ }
3080
3086
  break;
3081
3087
  case 'mouseenter':
3082
3088
  if (this.element.hoverToggle) {
@@ -3085,7 +3091,7 @@ class AuroFloatingUI {
3085
3091
  break;
3086
3092
  case 'mouseleave':
3087
3093
  if (this.element.hoverToggle) {
3088
- this.hideBib();
3094
+ this.hideBib("mouseleave");
3089
3095
  }
3090
3096
  break;
3091
3097
  case 'focus':
@@ -4473,6 +4479,9 @@ class AuroDropdown extends AuroElement$2 {
4473
4479
 
4474
4480
  this.parentBorder = false;
4475
4481
 
4482
+ /** @private */
4483
+ this.handleDropdownToggle = this.handleDropdownToggle.bind(this);
4484
+
4476
4485
  this.privateDefaults();
4477
4486
  }
4478
4487
 
@@ -4906,12 +4915,19 @@ class AuroDropdown extends AuroElement$2 {
4906
4915
  if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
4907
4916
  this.handleTriggerContentSlotChange();
4908
4917
  }
4918
+ }
4909
4919
 
4910
- if (changedProperties.has('isPopoverVisible')) {
4911
- this.updateFocusTrap();
4912
- if (!this.isPopoverVisible && this.hasFocus) {
4913
- this.trigger.focus();
4914
- }
4920
+ /**
4921
+ * Handles the custom event `auroDropdown-toggled` to update the visibility of the dropdown bib.
4922
+ * @private
4923
+ * @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
4924
+ */
4925
+ handleDropdownToggle(event) {
4926
+ this.updateFocusTrap();
4927
+ this.isPopoverVisible = event.detail.expanded;
4928
+ const eventType = event.detail.eventType || "unknown";
4929
+ if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
4930
+ this.trigger.focus();
4915
4931
  }
4916
4932
  }
4917
4933
 
@@ -4919,6 +4935,7 @@ class AuroDropdown extends AuroElement$2 {
4919
4935
 
4920
4936
  // Configure the floater to, this will generate the ID for the bib
4921
4937
  this.floater.configure(this, 'auroDropdown');
4938
+ this.addEventListener('auroDropdown-toggled', this.handleDropdownToggle);
4922
4939
 
4923
4940
  /**
4924
4941
  * @description Let subscribers know that the dropdown ID ha been generated and added.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurodesignsystem-dev/auro-formkit",
3
- "version": "0.0.0-pr783.0",
3
+ "version": "0.0.0-pr783.1",
4
4
  "description": "A collection of web components used to build forms.",
5
5
  "homepage": "https://github.com/AlaskaAirlines/auro-formkit#readme",
6
6
  "bugs": {
@@ -53,7 +53,7 @@
53
53
  "local-demo": "npm run build && sh ./local-demo.sh --zip"
54
54
  },
55
55
  "dependencies": {
56
- "@aurodesignsystem/auro-library": "^5.2.2",
56
+ "@aurodesignsystem/auro-library": "^5.3.0",
57
57
  "@lit/reactive-element": "^2.1.0",
58
58
  "lit": "^3.2.1"
59
59
  },