@aurodesignsystem-dev/auro-formkit 0.0.0-pr1408.14 → 0.0.0-pr1408.16
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/components/checkbox/demo/api.min.js +1 -1
- package/components/checkbox/demo/index.min.js +1 -1
- package/components/checkbox/demo/keyboardBehavior.md +0 -0
- package/components/checkbox/dist/index.js +1 -1
- package/components/checkbox/dist/registered.js +1 -1
- package/components/combobox/demo/api.min.js +139 -142
- package/components/combobox/demo/index.min.js +139 -142
- package/components/combobox/demo/keyboardBehavior.md +1 -2
- package/components/combobox/dist/index.js +105 -115
- package/components/combobox/dist/registered.js +105 -115
- package/components/counter/demo/api.md +1 -1
- package/components/counter/demo/api.min.js +202 -146
- package/components/counter/demo/index.min.js +202 -146
- package/components/counter/dist/auro-counter.d.ts +11 -8
- package/components/counter/dist/index.js +202 -146
- package/components/counter/dist/keyboardStrategy.d.ts +4 -0
- package/components/counter/dist/registered.js +202 -146
- package/components/datepicker/demo/api.min.js +107 -118
- package/components/datepicker/demo/index.min.js +107 -118
- package/components/datepicker/dist/index.js +102 -113
- package/components/datepicker/dist/registered.js +102 -113
- package/components/dropdown/demo/api.md +29 -29
- package/components/dropdown/demo/api.min.js +117 -121
- package/components/dropdown/demo/index.min.js +117 -121
- package/components/dropdown/dist/auro-dropdown.d.ts +3 -3
- package/components/dropdown/dist/auro-dropdownBib.d.ts +1 -40
- package/components/dropdown/dist/dropdownBibKeyboardStrategy.d.ts +7 -0
- package/components/dropdown/dist/index.js +101 -109
- package/components/dropdown/dist/registered.js +101 -109
- package/components/form/demo/api.min.js +629 -544
- package/components/form/demo/index.min.js +629 -544
- package/components/form/demo/keyboardBehavior.md +0 -0
- package/components/input/demo/api.min.js +1 -1
- package/components/input/demo/index.min.js +1 -1
- package/components/input/demo/keyboardBehavior.md +0 -0
- package/components/input/dist/index.js +1 -1
- package/components/input/dist/registered.js +1 -1
- package/components/menu/demo/api.min.js +34 -27
- package/components/menu/demo/index.min.js +34 -27
- package/components/menu/dist/auro-menu.d.ts +0 -6
- package/components/menu/dist/index.js +34 -27
- package/components/menu/dist/registered.js +34 -27
- package/components/radio/demo/api.min.js +1 -1
- package/components/radio/demo/index.min.js +1 -1
- package/components/radio/dist/index.js +1 -1
- package/components/radio/dist/registered.js +1 -1
- package/components/select/demo/api.min.js +214 -164
- package/components/select/demo/index.min.js +214 -164
- package/components/select/demo/keyboardBehavior.md +3 -3
- package/components/select/dist/index.js +180 -137
- package/components/select/dist/registered.js +180 -137
- package/components/select/dist/selectKeyboardStrategy.d.ts +5 -2
- package/custom-elements.json +1518 -1481
- package/package.json +8 -6
|
@@ -3,6 +3,8 @@ import { classMap } from 'lit/directives/class-map.js';
|
|
|
3
3
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
4
4
|
import { css, html, LitElement } from 'lit';
|
|
5
5
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
6
|
+
import 'lit-html';
|
|
7
|
+
import 'lit-html/directives/unsafe-html.js';
|
|
6
8
|
|
|
7
9
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
8
10
|
// See LICENSE in the project root for license information.
|
|
@@ -1793,6 +1795,11 @@ class AuroFloatingUI {
|
|
|
1793
1795
|
this.clickHandler = null;
|
|
1794
1796
|
this.keyDownHandler = null;
|
|
1795
1797
|
|
|
1798
|
+
/**
|
|
1799
|
+
* @private
|
|
1800
|
+
*/
|
|
1801
|
+
this.enableKeyboardHandling = true;
|
|
1802
|
+
|
|
1796
1803
|
/**
|
|
1797
1804
|
* @private
|
|
1798
1805
|
*/
|
|
@@ -2053,11 +2060,10 @@ class AuroFloatingUI {
|
|
|
2053
2060
|
return;
|
|
2054
2061
|
}
|
|
2055
2062
|
|
|
2056
|
-
const { activeElement } = document;
|
|
2057
2063
|
// if focus is still inside of trigger or bib, do not close
|
|
2058
2064
|
if (
|
|
2059
|
-
this.element.
|
|
2060
|
-
this.element.
|
|
2065
|
+
this.element.matches(":focus") ||
|
|
2066
|
+
this.element.matches(":focus-within")
|
|
2061
2067
|
) {
|
|
2062
2068
|
return;
|
|
2063
2069
|
}
|
|
@@ -2128,7 +2134,9 @@ class AuroFloatingUI {
|
|
|
2128
2134
|
document.addEventListener("focusin", this.focusHandler);
|
|
2129
2135
|
}
|
|
2130
2136
|
|
|
2131
|
-
|
|
2137
|
+
if (this.enableKeyboardHandling) {
|
|
2138
|
+
document.addEventListener("keydown", this.keyDownHandler);
|
|
2139
|
+
}
|
|
2132
2140
|
|
|
2133
2141
|
// send this task to the end of queue to prevent conflicting
|
|
2134
2142
|
// it conflicts if showBib gets call from a button that's not this.element.trigger
|
|
@@ -2384,8 +2392,9 @@ class AuroFloatingUI {
|
|
|
2384
2392
|
this.element.bib.setAttribute("id", `${this.id}-floater-bib`);
|
|
2385
2393
|
}
|
|
2386
2394
|
|
|
2387
|
-
configure(elem, eventPrefix) {
|
|
2395
|
+
configure(elem, eventPrefix, enableKeyboardHandling = true) {
|
|
2388
2396
|
AuroFloatingUI.setupMousePressChecker();
|
|
2397
|
+
this.enableKeyboardHandling = enableKeyboardHandling;
|
|
2389
2398
|
|
|
2390
2399
|
this.eventPrefix = eventPrefix;
|
|
2391
2400
|
if (this.element !== elem) {
|
|
@@ -2418,7 +2427,9 @@ class AuroFloatingUI {
|
|
|
2418
2427
|
|
|
2419
2428
|
this.handleEvent = this.handleEvent.bind(this);
|
|
2420
2429
|
if (this.element.trigger) {
|
|
2421
|
-
|
|
2430
|
+
if (this.enableKeyboardHandling) {
|
|
2431
|
+
this.element.trigger.addEventListener("keydown", this.handleEvent);
|
|
2432
|
+
}
|
|
2422
2433
|
this.element.trigger.addEventListener("click", this.handleEvent);
|
|
2423
2434
|
this.element.trigger.addEventListener("mouseenter", this.handleEvent);
|
|
2424
2435
|
this.element.trigger.addEventListener("mouseleave", this.handleEvent);
|
|
@@ -2896,12 +2907,83 @@ class p{registerComponent(t,a){customElements.get(t)||customElements.define(t,cl
|
|
|
2896
2907
|
|
|
2897
2908
|
var iconVersion = '9.1.2';
|
|
2898
2909
|
|
|
2910
|
+
/**
|
|
2911
|
+
* Computes display state once per keydown event.
|
|
2912
|
+
* Centralizes null-safety checks and makes the shared/modal/popover branching explicit.
|
|
2913
|
+
*
|
|
2914
|
+
* @param {HTMLElement} component - The component with a dropdown reference.
|
|
2915
|
+
* @param {Object} [options] - Optional config.
|
|
2916
|
+
* @param {HTMLElement} [options.dropdown] - Explicit dropdown reference. Falls back to component.dropdown.
|
|
2917
|
+
* @param {Function} [options.inputResolver] - Called with (component, ctx) to resolve the active input element.
|
|
2918
|
+
* @returns {{isExpanded: boolean, isModal: boolean, isPopover: boolean, activeInput: HTMLElement|null}}
|
|
2919
|
+
* isModal and isPopover reflect the display mode (fullscreen vs not) regardless of expanded state.
|
|
2920
|
+
*/
|
|
2921
|
+
function createDisplayContext(component, options = {}) {
|
|
2922
|
+
const dd = options.dropdown || component.dropdown;
|
|
2923
|
+
// isPopoverVisible reflects as the `open` attribute.
|
|
2924
|
+
// It reports whether the bib is open in any mode (popover or modal).
|
|
2925
|
+
const isExpanded = Boolean(dd && dd.isPopoverVisible);
|
|
2926
|
+
const isFullscreen = Boolean(dd && dd.isBibFullscreen);
|
|
2927
|
+
|
|
2928
|
+
const ctx = {
|
|
2929
|
+
isExpanded,
|
|
2930
|
+
isModal: isFullscreen,
|
|
2931
|
+
isPopover: !isFullscreen,
|
|
2932
|
+
activeInput: null,
|
|
2933
|
+
};
|
|
2934
|
+
|
|
2935
|
+
if (options.inputResolver) {
|
|
2936
|
+
const resolvedInput = options.inputResolver(component, ctx);
|
|
2937
|
+
// Guard against resolvers returning undefined or non-HTMLElement values.
|
|
2938
|
+
ctx.activeInput = resolvedInput instanceof HTMLElement ? resolvedInput : null;
|
|
2939
|
+
}
|
|
2940
|
+
|
|
2941
|
+
return ctx;
|
|
2942
|
+
}
|
|
2943
|
+
|
|
2944
|
+
/**
|
|
2945
|
+
* Wires up a keydown listener that dispatches to strategy[evt.key] or strategy.default.
|
|
2946
|
+
* Handles both sync and async handlers.
|
|
2947
|
+
* @param {HTMLElement} component - The component to attach the listener to.
|
|
2948
|
+
* @param {Object} strategy - Map of key names to handler functions.
|
|
2949
|
+
* @param {Object} [options] - Optional config passed to createDisplayContext.
|
|
2950
|
+
*/
|
|
2951
|
+
function applyKeyboardStrategy(component, strategy, options = {}) {
|
|
2952
|
+
component.addEventListener('keydown', async (evt) => {
|
|
2953
|
+
const handler = strategy[evt.key] || strategy.default;
|
|
2954
|
+
if (typeof handler === 'function') {
|
|
2955
|
+
const ctx = createDisplayContext(component, options);
|
|
2956
|
+
await handler(component, evt, ctx);
|
|
2957
|
+
}
|
|
2958
|
+
});
|
|
2959
|
+
}
|
|
2960
|
+
|
|
2899
2961
|
var styleCss$2 = css`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}:host dialog{width:auto;max-width:none;height:auto;max-height:none;padding:0;border:none;margin:0;outline:none;transform:translateZ(0)}:host dialog::backdrop{background:transparent}:host(:not([isfullscreen])) dialog{position:relative;inset:unset}:host(:not([isfullscreen])) .container.shape-box{border-radius:unset}:host(:not([isfullscreen])) .container[class*=shape-pill],:host(:not([isfullscreen])) .container[class*=shape-snowflake]{border-radius:30px}:host(:not([isfullscreen])) .container[class*=shape-rounded]{border-radius:16px}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([isfullscreen]) .container::backdrop{background:var(--ds-color-background-primary, #fff)}:host(:popover-open){position:fixed;overflow:visible;padding:0;border:none;margin:0;background:transparent;inset:unset;outline:none}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}.container{display:inline-block;overflow:auto;box-sizing:border-box;border-radius:var(--ds-border-radius, 0.375rem);margin:var(--ds-size-50, 0.25rem) 0}.util_displayHiddenVisually{position:absolute;overflow:hidden;width:1px;height:1px;padding:0;border:0;margin:-1px;clip-path:inset(50%);white-space:nowrap}`;
|
|
2900
2962
|
|
|
2901
2963
|
var colorCss$2 = css`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
2902
2964
|
|
|
2903
2965
|
var tokensCss$1 = css`:host(:not([ondark])),:host(:not([appearance=inverse])){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-muted, #676767);--ds-auro-dropdown-trigger-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-hover-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-bold, #585e67);--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-default, #2a2a2a);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-background-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]),:host([appearance=inverse]){--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db);--ds-auro-dropdown-trigger-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-hover-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: transparent;--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-dropdownbib-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-background-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdownbib-container-color: var(--ds-advanced-color-shared-background-inverse, rgba(255, 255, 255, 0.15));--ds-auro-dropdownbib-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}`;
|
|
2904
2966
|
|
|
2967
|
+
/**
|
|
2968
|
+
* Creates a keyboard strategy for dialog-specific key handling.
|
|
2969
|
+
* All other keydown behavior is left to the browser's native bubbling path.
|
|
2970
|
+
* @param {HTMLElement} bib - The dropdown bib element.
|
|
2971
|
+
* @returns {Object} Keyboard handlers keyed by `event.key`.
|
|
2972
|
+
*/
|
|
2973
|
+
// eslint-disable-next-line no-unused-vars
|
|
2974
|
+
function createDropdownBibKeyboardStrategy(bib) {
|
|
2975
|
+
return {
|
|
2976
|
+
// eslint-disable-next-line no-unused-vars
|
|
2977
|
+
Enter(_dialog, event) {
|
|
2978
|
+
// Floating UI handles Enter key to open the dropdown
|
|
2979
|
+
},
|
|
2980
|
+
// eslint-disable-next-line no-unused-vars
|
|
2981
|
+
Escape(_dialog, event) {
|
|
2982
|
+
// Floating UI handles Escape key to close the dropdown
|
|
2983
|
+
}
|
|
2984
|
+
};
|
|
2985
|
+
}
|
|
2986
|
+
|
|
2905
2987
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
2906
2988
|
// See LICENSE in the project root for license information.
|
|
2907
2989
|
/* eslint-disable max-lines */
|
|
@@ -3026,11 +3108,7 @@ class AuroDropdownBib extends LitElement {
|
|
|
3026
3108
|
},
|
|
3027
3109
|
|
|
3028
3110
|
/**
|
|
3029
|
-
*
|
|
3030
|
-
* aria-activedescendant. The dialog keyboard bridge checks this
|
|
3031
|
-
* flag so that Enter selects the highlighted option instead of
|
|
3032
|
-
* activating the focused interactive element (e.g. the trigger
|
|
3033
|
-
* button, or the bibtemplate close button in fullscreen).
|
|
3111
|
+
* Tracks whether a menu option is currently highlighted.
|
|
3034
3112
|
* @private
|
|
3035
3113
|
*/
|
|
3036
3114
|
hasActiveDescendant: {
|
|
@@ -3104,7 +3182,7 @@ class AuroDropdownBib extends LitElement {
|
|
|
3104
3182
|
|
|
3105
3183
|
const dialog = this.shadowRoot.querySelector('dialog');
|
|
3106
3184
|
this._setupCancelHandler(dialog);
|
|
3107
|
-
|
|
3185
|
+
applyKeyboardStrategy(dialog, createDropdownBibKeyboardStrategy());
|
|
3108
3186
|
|
|
3109
3187
|
this.dispatchEvent(new CustomEvent('auro-dropdownbib-connected', {
|
|
3110
3188
|
bubbles: true,
|
|
@@ -3131,92 +3209,6 @@ class AuroDropdownBib extends LitElement {
|
|
|
3131
3209
|
});
|
|
3132
3210
|
}
|
|
3133
3211
|
|
|
3134
|
-
/**
|
|
3135
|
-
* showModal() creates a closed focus scope — keyboard events inside
|
|
3136
|
-
* the dialog's shadow DOM do NOT bubble out to the combobox/select
|
|
3137
|
-
* keydown handlers in the parent shadow DOM. This handler bridges
|
|
3138
|
-
* that gap by re-dispatching navigation keys so they cross the
|
|
3139
|
-
* shadow boundary and reach the menu navigation logic in the parent
|
|
3140
|
-
* component.
|
|
3141
|
-
*
|
|
3142
|
-
* The trade-off: intercepting these keys means native keyboard
|
|
3143
|
-
* behaviors that would normally "just work" must be manually
|
|
3144
|
-
* re-implemented here:
|
|
3145
|
-
*
|
|
3146
|
-
* - Enter on buttons: Custom elements (auro-button) don't get the
|
|
3147
|
-
* native Enter→click that <button> provides, so we call .click()
|
|
3148
|
-
* directly when Enter is pressed on a button-like element.
|
|
3149
|
-
*
|
|
3150
|
-
* - Tab: Intercepted and re-dispatched so parent components
|
|
3151
|
-
* (select/combobox) can select the active option and close the
|
|
3152
|
-
* dialog. The <dialog> provides containment and isolation
|
|
3153
|
-
* (inert background, VoiceOver focus trapping, top layer), while
|
|
3154
|
-
* the content inside is a role="listbox" navigated via
|
|
3155
|
-
* aria-activedescendant (options are not focusable). Tab keyboard
|
|
3156
|
-
* behavior follows listbox conventions (select + close) because
|
|
3157
|
-
* the dialog's native Tab trap only cycles between the close
|
|
3158
|
-
* button and browser chrome.
|
|
3159
|
-
*
|
|
3160
|
-
* - Escape: The native <dialog> fires a `cancel` event on ESC
|
|
3161
|
-
* (handled by _setupCancelHandler), so the re-dispatched Escape
|
|
3162
|
-
* is a secondary path for parent components that also listen for
|
|
3163
|
-
* Escape keydown.
|
|
3164
|
-
*
|
|
3165
|
-
* @param {HTMLDialogElement} dialog - The dialog element to attach the keyboard bridge to.
|
|
3166
|
-
* @private
|
|
3167
|
-
*/
|
|
3168
|
-
_setupKeyboardBridge(dialog) {
|
|
3169
|
-
const navKeys = new Set([
|
|
3170
|
-
'ArrowUp',
|
|
3171
|
-
'ArrowDown',
|
|
3172
|
-
'Enter',
|
|
3173
|
-
'Escape',
|
|
3174
|
-
'Tab'
|
|
3175
|
-
]);
|
|
3176
|
-
|
|
3177
|
-
dialog.addEventListener('keydown', (event) => {
|
|
3178
|
-
if (!navKeys.has(event.key)) {
|
|
3179
|
-
return;
|
|
3180
|
-
}
|
|
3181
|
-
|
|
3182
|
-
// Custom elements (auro-button) don't get the native Enter→click
|
|
3183
|
-
// behavior that <button> has. Find the button in the composed path
|
|
3184
|
-
// and click it directly — but only when no menu option is
|
|
3185
|
-
// highlighted. In fullscreen mode focus stays on the close button
|
|
3186
|
-
// while arrow keys move the active-descendant highlight through
|
|
3187
|
-
// the listbox. If the user presses Enter with an option
|
|
3188
|
-
// highlighted, the intent is to select that option, not to click
|
|
3189
|
-
// the close button. In that case we fall through and bridge the
|
|
3190
|
-
// Enter key to the parent component's keyboard strategy.
|
|
3191
|
-
if (event.key === 'Enter') {
|
|
3192
|
-
if (!this.hasActiveDescendant) {
|
|
3193
|
-
const buttonSelector = 'button, [role="button"], auro-button, [auro-button]';
|
|
3194
|
-
const btn = event.composedPath().find((el) => el.matches && el.matches(buttonSelector));
|
|
3195
|
-
if (btn) {
|
|
3196
|
-
event.preventDefault();
|
|
3197
|
-
event.stopPropagation();
|
|
3198
|
-
btn.click();
|
|
3199
|
-
return;
|
|
3200
|
-
}
|
|
3201
|
-
}
|
|
3202
|
-
}
|
|
3203
|
-
|
|
3204
|
-
event.preventDefault();
|
|
3205
|
-
event.stopPropagation();
|
|
3206
|
-
const newEvent = new KeyboardEvent('keydown', {
|
|
3207
|
-
key: event.key,
|
|
3208
|
-
code: event.code,
|
|
3209
|
-
shiftKey: event.shiftKey,
|
|
3210
|
-
altKey: event.altKey,
|
|
3211
|
-
ctrlKey: event.ctrlKey,
|
|
3212
|
-
metaKey: event.metaKey,
|
|
3213
|
-
bubbles: true,
|
|
3214
|
-
composed: true,
|
|
3215
|
-
cancelable: true
|
|
3216
|
-
});
|
|
3217
|
-
this.dispatchEvent(newEvent);
|
|
3218
|
-
});
|
|
3219
|
-
}
|
|
3220
3212
|
|
|
3221
3213
|
/**
|
|
3222
3214
|
* Blocks touch-driven page scroll while a fullscreen modal dialog is open.
|
|
@@ -3591,7 +3583,7 @@ class AuroHelpText extends LitElement {
|
|
|
3591
3583
|
}
|
|
3592
3584
|
}
|
|
3593
3585
|
|
|
3594
|
-
var formkitVersion = '
|
|
3586
|
+
var formkitVersion = '202604022013';
|
|
3595
3587
|
|
|
3596
3588
|
class AuroElement extends LitElement {
|
|
3597
3589
|
static get properties() {
|
|
@@ -3772,7 +3764,7 @@ class AuroDropdown extends AuroElement {
|
|
|
3772
3764
|
this.appearance = 'default';
|
|
3773
3765
|
this.chevron = false;
|
|
3774
3766
|
this.disabled = false;
|
|
3775
|
-
this.
|
|
3767
|
+
this.disableKeyboardHandling = false;
|
|
3776
3768
|
this.error = false;
|
|
3777
3769
|
this.tabIndex = 0;
|
|
3778
3770
|
this.noToggle = false;
|
|
@@ -3870,9 +3862,8 @@ class AuroDropdown extends AuroElement {
|
|
|
3870
3862
|
// showModal() fires asynchronously via Lit's update cycle, which
|
|
3871
3863
|
// falls outside the user activation window and causes iOS to
|
|
3872
3864
|
// dismiss the keyboard.
|
|
3873
|
-
if (this.
|
|
3874
|
-
|
|
3875
|
-
this.bibElement.value.open(useModal);
|
|
3865
|
+
if (this.bibElement && this.bibElement.value) {
|
|
3866
|
+
this.bibElement.value.open(this.isBibFullscreen);
|
|
3876
3867
|
}
|
|
3877
3868
|
}
|
|
3878
3869
|
|
|
@@ -3986,9 +3977,9 @@ class AuroDropdown extends AuroElement {
|
|
|
3986
3977
|
},
|
|
3987
3978
|
|
|
3988
3979
|
/**
|
|
3989
|
-
* If declared, the
|
|
3980
|
+
* If declared, the dropdown will not handle keyboard events and will require the consumer to manage this behavior.
|
|
3990
3981
|
*/
|
|
3991
|
-
|
|
3982
|
+
disableKeyboardHandling: {
|
|
3992
3983
|
type: Boolean,
|
|
3993
3984
|
reflect: true
|
|
3994
3985
|
},
|
|
@@ -4266,7 +4257,7 @@ class AuroDropdown extends AuroElement {
|
|
|
4266
4257
|
if (this.isPopoverVisible) {
|
|
4267
4258
|
// Fullscreen: use showModal() for native accessibility (inert outside, focus trap)
|
|
4268
4259
|
// Desktop: use show() for Floating UI positioning + FocusTrap for focus management
|
|
4269
|
-
const useModal = this.isBibFullscreen
|
|
4260
|
+
const useModal = this.isBibFullscreen;
|
|
4270
4261
|
this.bibElement.value.open(useModal);
|
|
4271
4262
|
} else {
|
|
4272
4263
|
this.bibElement.value.close();
|
|
@@ -4276,7 +4267,7 @@ class AuroDropdown extends AuroElement {
|
|
|
4276
4267
|
// When fullscreen strategy changes while open, re-open dialog with correct mode
|
|
4277
4268
|
// (e.g. resizing from desktop → mobile while dropdown is open)
|
|
4278
4269
|
if (changedProperties.has('isBibFullscreen') && this.isPopoverVisible && this.bibElement.value) {
|
|
4279
|
-
const useModal = this.isBibFullscreen
|
|
4270
|
+
const useModal = this.isBibFullscreen;
|
|
4280
4271
|
this.bibElement.value.close();
|
|
4281
4272
|
this.bibElement.value.open(useModal);
|
|
4282
4273
|
}
|
|
@@ -4298,7 +4289,7 @@ class AuroDropdown extends AuroElement {
|
|
|
4298
4289
|
|
|
4299
4290
|
firstUpdated() {
|
|
4300
4291
|
// Configure the floater to, this will generate the ID for the bib
|
|
4301
|
-
this.floater.configure(this, 'auroDropdown');
|
|
4292
|
+
this.floater.configure(this, 'auroDropdown', !this.disableKeyboardHandling);
|
|
4302
4293
|
|
|
4303
4294
|
// Prevent `contain: layout` on the dropdown host. Layout containment
|
|
4304
4295
|
// creates a containing block for position:fixed descendants (the bib),
|
|
@@ -4388,7 +4379,7 @@ class AuroDropdown extends AuroElement {
|
|
|
4388
4379
|
* @private
|
|
4389
4380
|
*/
|
|
4390
4381
|
updateFocusTrap() {
|
|
4391
|
-
if (this.isPopoverVisible
|
|
4382
|
+
if (this.isPopoverVisible) {
|
|
4392
4383
|
if (!this.isBibFullscreen) {
|
|
4393
4384
|
// Desktop: show() doesn't trap focus, so use FocusTrap
|
|
4394
4385
|
this.focusTrap = new FocusTrap(this.bibContent);
|
|
@@ -4606,6 +4597,7 @@ class AuroDropdown extends AuroElement {
|
|
|
4606
4597
|
aria-expanded="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.isPopoverVisible)}"
|
|
4607
4598
|
aria-controls="${ifDefined(this.a11yRole === 'button' || this.triggerContentFocusable ? undefined : this.dropdownId)}"
|
|
4608
4599
|
aria-labelledby="${ifDefined(this.triggerContentFocusable ? undefined : 'triggerLabel')}"
|
|
4600
|
+
aria-disabled="${ifDefined(this.disabled ? 'true' : undefined)}"
|
|
4609
4601
|
@focusin="${this.handleFocusin}"
|
|
4610
4602
|
@blur="${this.handleFocusOut}">
|
|
4611
4603
|
<div class="triggerContentWrapper" id="triggerLabel">
|